The PluginManager contains a lot of duplicate code. I already removed a bunch of it by introducing a the templated PluginInstance class, and this is the next step in the process.
There's a lot more that can be done, but for these kind of changes I like to work incrementally. Given that this touches a lot of code I'd appreciate a second set of eyes to spot any mistakes.