Added unit testing project and clean up some code