Make the plugin manager a regular member instead of a singleton.

This removes a bunch of lifetime/parenting hacks, and it will simplify
creating one per plugin type in the future.