moved tests to junit, and did some minor cleanup