Renamed some stuff and moved the date sanitizing to be more generally useful.