ticket:13 tests for sorting
Merge branch 't13_customer'. With fixes.