create a plugin architecture for things to fit into

Probably not quite ready yet, still lacking some test coverage, but almost there.