Instead of modifying the contents of the .npm directory inside a package directory, construct a new temporary directory and atomically replace at the end. Also, some minor improvements to testing and pruning unused packages
meteor test-package
meteor test-package --deploy