More unit tests, small ammount of clean up, and more comments