Changed models and added lots of relationships. Reworked library to match