cleanup: remove dead code and globals
makefile: force recompilation when make test is invoked
tests: unit test 3 new functions