gatekeeper: Fix creation of objects and add basic test suite