Sort routes more intelligently, fixes #7