Add timetable.py script to print timetable for a route.

It also knows how to print a list of routes in the database.
Currently the timetables are printed in a text format, with stops
going horizontally and trips vertically.

Also add a suite of trip-related tools, which allow for loading
a route's timetable from the db into a convenient internal
representation for further processing. This requires classifying
the trips by direction and sorting by time (using a topological sort,
because trips may not all overlap with each other).