Register object classes on plugin activation and unregister them on deactivation

Classes left behind in the database after plugin deactivation were giving a notice
(e.g. "Class 'Event' was not found").