Features/register plugins

Better API for plugin registration.