Modular python common (revised)

This is an extension to https://github.com/numenta/nupic/pull/145 to feature some minor cleanup tasks following feedback.