Added support for plugin init/uninit functions.

These are called by the plugin system when the plugin is either
loaded or unloaded and before it does anything else (such as register
commands, etc).