Bug 916316 - Optimize date formatting

Factoring out, testing (against the old implementation), benchmarking, and speeding up in general.