Clean up

Cleaned up code, removed old files, added some comments for
documentation.