[BUGFIX] Recursion check in ResourceDefinitionFactory

Added check in order to support resources with properties
pointing to itself.
[FEATURE] Support for single embedded resources

Up to now only embedded collection were supported.