Rebuild the plugin system in a more OO approach.

This rewrites a lot of hook.py, ands moves a bunch of stuff from loader.py to pluginmanager.py.

It also removes @hook.singlethread, in favor of singlethread=True param.

It adds support for multiple commands in a hook "@hook.command(["cmd1", "cmd2"])", as well as multiple regexes and events in one regex/event hook.

It does not yet support reloading plugins, though there are just a few more lines of code to write to fix that.
Probably ruin everything!
overexcited refactoring
Curse you, random debug thing
fix
Rename register_module and unregister_module to register_plugins and unregister_plugins, because that's what it's doing.

Those methods register all the plugins in a module, whereas load_module and unload_module will load and unload the modules.

Also rename load_modules to load_module, because I'm pretty sure that the function which loads one module was meant to have that name ,-,

Also get rid of load_modules wihch loads all modules in a list, as it's never used and probably won't be.

Move documentation comment into documentation for PluginManager, Module and Plugin.

Get rid of plugin_desc and implementing __str__ in the base Plugin, when plugin_desc just checks isinstance anyways. Instead have the __str__ be implemented in each plugin class, and return the same formatting string that plugin_desc would have given it.

Also implement __repr__ separately from __str__, see http://stackoverflow.com/questions/1436703

Related to that, make log_plugin use just plugin instead of plugin_desc(plugin)

Another thing, fixes the way that CommandPlugin assigns autohelp and permissions.
Fix singlethread plugins
Change server_password config to connection.password
Make bytes conversion on both path and name in unload_file. Also, add assert case in pluginmanager unregister_plugins to make errors more clear.
Make log run in single thread, I was getting errors which were caused by concurrent access of stream_cache
Just to remove an irrelevant error until this is rewritten - TODO: Fix this
Three fixes for main.py:
- Add _input_name_aliases to avoid having duplicate variables on input
- Fix three uses of plugin.fileplugin to plugin.module
- Make Handler actually call the run function with the plugin, not the function
- Remove various places input.inp is set, as it doesn't need to be with _input_name_aliases
Oops, json error!
Log using configuration name, rather than irc server in []
This fix is module instead of file_plugin
Implement plugin reloading. TODO: Check for memory leaks in this
spelling!
Use importlib when available
Remove uses of 'kind' as it can be accessed with plugin.type
Change @hook.sieve to use plugin variable instead of func, kind, args