loggertodb uses cliapp, and related improvements

Changed loggertodb to use the cliapp framework. For this, made a
couple of improvements to cliapp ("dry" argument to "run", and option
to not check a configuration file section). Related file
re-organizations, and some fixes in testing code.
Added enhydris_api.get_ts_end_date()
Added add_months_to_datetime utility function