Support for plugins (closes #1) and closes #3