Cleanup and add some more rudimentary tests