Changes to output for convertdate().

With this change, another script that calls this file's convertdate()
function can automatically retrieve the converted date format,
instead of having to ask for self.date in another line.

This change would not change how the date can be called, but from
now on, self.date will be deprecated, but will still be kept for
backward compatibility.

Also with this change, adds a hook to check that the script isn't
called directly from the command line.