The history completion query is extended to pick only the most recent item for a given url. The tests in test_models now check for ordering of elements.