Change DocumentActivate and DocumentDeactivate handlers to run only befor/after event rather than every time event is fired.
InvDocument.InternalDocument returns object from InventorPersistenceManager rather than storing it itself.
Delete class.