Restore generality, some improvements, update documentation.

All code specific to my instances of this program have been removed,
and a few things that I don't use have been restored. Documentation
has been re-written with this in mind. As of this commit this
program should be at least somewhat usable by others.

The time system has been overhauled to use the datetime library;
this apparently fixes several subtle time-related bugs.

Error handling has been further improved. Code prettiness is now
in line with pylint standards. A small test suite has been added.