Adds support for registering and unregistering.

The library now exposes the complete functionality of the
register and unregister API.
Updates the documentation to reflect new options.