Checks whether queryParams.order is a function or string in the fix of sorting parameters

When the order queryParam parameter was a function the fix produced
incorrect query parameters.
Fix code style
Adds test case for queryParams.order as a function
Merge pull request #227 from pekala/master

Fix for queryParams.order being a function