add plugin support

I still need to double check the implementation and documentation, but it looks like this will be flexible enough.

closes #89