Bug 916316 - Memoize date formatting

Not just memoizing… also factoring out, testing (against the old implementation), benchmarking, and speeding up in general.