Initial UnitTest/CI Work

Starting a pull request for some initial UnitTest and general cleanup work. Will merge into master as soon as there are some useful unit tests in place.