Shared Pointers for plugins, hooks get types

- The plugin system now uses shared pointers.
- Some cleaning up in MBus done
- Hooks now have an int type and a get_type() method which lets you
  either get the type int or probe for types.