Fix sorting without using the MultipleSort object.

SQL syntax error when using a simple FlexFieldSort.
Add unit tests for fixef and flex field sort