Optimise Orm::query()

Add some memoisation to the reduce calls to getModel() and addToIdentityMap()
Correct typo in function name addToIdentityMap