Created middleware modules out of ACL and REST implementations.
Allow ACL checks, even for populated fields.
Added pet ACLs.
Refactored parts of schema and resource modules.