Cleanup

This branch reformats some files and deletes some unused code.