Bugfix: TimeRange comparisons also work with non-TimeRanges

Also, I used functools' @total_ordering decorator. It makes your life a lot
easier!