Major rewrite to handle "change" action correctly.

The script can now be used to manage media-reader type devices
like optical drives and SD card readers.

Also, test files are now in the main tree.