Minor refactoring: move code closer to where it used
Inheritance bug fixed
Imroved inheritance support in queries
Entity.__getitem__() & Entity.exists() bug fixed
Merge branch 'master' to 'orm': bugfixes