Optimize getPackageDir() function

Solves: https://github.com/numenta/nupic.core/issues/114