[FLINK-1112] Add KeySelector group sorting on KeySelector grouping

This closes #209
[FLINK-1112] Additional checks for KeySelector group sorting and minor fixes