Merge pull request #949 from flamholz/master

Lots of little changes accumulated from time spent poring over routing code.