Make datetime objects comparable

This implements *greater than* and *less than* comparisons for datetime objects.

Previously, comparisons would fail on Python 3, and produce arbitrary results on Python 2.