Simplify Temporal Memory code

Fixes https://github.com/numenta/nupic/issues/1473.