Add support for default sorting + tests.