Converted to a Library

Converted the file structure to a proper library. Closes issue #8. Commented and cleaned up all modules.