Lots of cleanup and removed old unit tests