Makes a lot of changes to support more complex and nested queries (related to dresende/node-orm2#95)
Removes forgotten console.log lines from previous commit