Modified the behaviour of sort. Now sorts within groups rather than glob...

I changed the reorderCols function as well as added cases when group and sort are present or not in the main function.

I think the code can be streamlined a little more by thinking about group being at least 1 and using lists, but this should work for now. Please let me know what you think.