Improved mongo criteria filtering and relationship behaviour
Added some tests for the schema