Test and correct dependencies for the object manager

This pull request cleans up a no-longer needed special case in the ObjectManager, introduces some tests that check if classes declare all their dependencies, and finally adds dependencies where they aren't declared.