Simplified doModifyLimitQuery per @deeky666 comments, added test case for orderby with parenthetical expression