Factor out some route-related code into routetools.py

For now, this is just get_routes() and a new get_service_days()
function that returns the list sets of days with distinct service patterns.
Fix ducktype

It used to mangle values like "01".