Added key and comparisons for sorted order.
Added key and comparisons for sorted order.

* Sorted order is sorting first by start points and then by end points.
* Implemented `__hash__` to go along with `__eq__`.

afbarnard/esal