Updates to ORM, fixed casting issues to and from database, added default loadByID method, moved query debugger into statement object