Added a entity manager helper, and started working on the database layer