Mer 2884 add unit tests

Adds some tests as well as a slightly modified run_tests.[sh | py] from nupic


@scottpurdy @chetan51 review