Mer 2884 add unit tests

Adds some tests as well as a slightly modified run_tests.[sh | py] from nupic


@scottpurdy @chetan51 review
It would be nice to have this in a separate file, but not essential.