minor cleanup + more tests
reorganization, begin unit testing