CMS-2482 Create EntityQuery class

Initial version