Make ORDER BY more flexible. Fixes #20