Inject plugins rather than just newInstance-ing them.

This also revamps plugin lifecycle a bit, assuming they set themselves up at
construct time, and using AutoCloseable to close them at life's end.