Optimize sensorimotor temporal memory

Counterpart to https://github.com/numenta/nupic/pull/1411.