Switch to postgres
Add indexes to tables; rewrite next_departing_train functions so that the time conversion will work with postgres