Fixes #4695: Passes more info to input/access and access hooks

First pass at getting more info into the input/access view and underlying hooks. Handlers of these hooks can now tell the type/subtype/container of the entity and are passed the entity itself if it already exists.

Also they're passed a "purpose" which defaults to "read". You can see the pages plugin needs to pass in "write" for the write_access_id instance of input/access. It uses a plugin hook to remove public write privileges instead of needing it's own input view.