Corrections for models

Added filterArrayByKeyListRecursive for models
Changed toArray() for entities