Deleting code duplication.
Add phpcr-odm support.