Add unit test coverage for ORDER BY, esp functions