Finished unit testing and confirming functionality

Much of the old code is ready to be removed.