moved timestamp_valid() to separate file and made the API public
Use a more efficient Rata Die algorithm by Peter Baum