Complete redo of plugin. Some features of old version not yet implemented.