Added a better, event-based, plugin system

Because the old one sucked and required database hackery
Remove the database handling for the plugin

We’ll use events to do this, in future
Turn SSL on properly in nginx
Remove the old initialization

We only used this to create indexes, and didn’t actually even bother to
do that. So we can remove it.
Restored the client side of file upload