This commit contains mostly re-location of code, but some
logic changes as well:
- Added the CACHE_DIR setting (previously it was hardcoded)
- Fixed the "cache last updated"/tnow timestamp re-using the
args.starttime variable. Previously, if a user invoked the script
with the starttime argument in the far future, the caches
"last_update" timestamp would've used this future date as a reference
(and thus the cache wouldn't be updated until this startdate passed)