DRY'd up the XML and JSON builder by moving timestamp formatting into a shared module.