Added plugin interface. Closes #176.