Date compare replacement

Replaced date_compare and similar functions with a single multiuse
function
date_compare update

Second commit (see previous)