moved all the classes in lib into app/models, changed classes to use instances of models instead of hashes