Partially handle some bugs; NOT stable
Moved database functionality to Full ORM construction and query generation