[WIP] Finalise support for plugin API 1.2

* now supports auto_unmount.
* cleanly handles directories and filenames.
* a minimum of configuration options