Add more robust nav sorting. Also, improve comment documentation and bugfix discover_title.