Refactored the library to be a bit more activerecordish