Speed up reading the db

Principally by storing dates as UTC instead of local time. Includes some
micro optimizations in the code paths to build the maps.