Added deregistration

Added a very basic way to deregister objects/functions