some incomplete changes
some simple tests, py2/3 compatibility
fix: test, test not passing
fix: fixed incorrect sortign bug i nthe Numpy version
update tools
factor out common code
put back teared-off code
some optimization