added setTimestamp to DateTime functions, accounts for null timestamp, added numerous sort functions

solves timestamp problem if validate_timestamp is disabled.
the sorting functions are needed for sorting the cached scripts