PluginManager rewrite part 2

This is turning out a bit bigger than I imagined