Fixed crashing bug with getNeighborsND (wrapAround=true case)

Fixes https://github.com/numenta/nupic.core/issues/125

@scottpurdy 
It is slightly difficult to understand what each of these test cases are checking. Could you add a short comment that would help?