Add support to unregister observers and interceptors.

This is a quick patch for #703.