API support for datetime.datetime

A class Timestamp is a subclass of datetime.datetime that has
extra functionality used to convert to and from the two datestamp
formats used by MediaWiki.  Timestamp.toISOformat outputs the
datetime in the format required for parameters to the MediaWiki API,
which is ISO 8601 with additional requirements, such as the 'Z' must
exist even though the timezone info is not included.

Timestamp.__str__ is an alias for Timestamp.toISOformat, and was used
when building API requests using str(timestamp).

Rather than require a Timestamp and implicitly use its __str__ to
obtain the required formatted string, api.py now supports datetime
directly and explicitly formats it using a format string to
obtain the representation the API requires for parameters.

Timestamp.isoformat now performs the same formatting, meaning its
output is slightly different that of the superclass, however they
are both valid ISO 8601 representations.

Timestamp.toISOformat is deprecated.

Change-Id: I6b975946bffd92f06dba53206f9097b573a0803d
Merge "API support for datetime.datetime"