Added hooks for document controller to handle events

Changed the way documents will be handled, instead of
a single instance for a document plugin there is a
instance per document.

This will allow events to be routed from the document
controller to the document plugin that is managing the
the document