Moved classes to separate .h/.cpp files

Also added comments and made small, minor name redefinitions...still
need to add error handling.