Groupby sort
PR as per issue 9444. One test added.
https://github.com/pydata/pandas/issues/9444

Continued in #9461

By the way, @cottrell, it is not needed to open an new PR. Just push force your cleaned up branch, and the PR will be updated automatically (as long as it is the same branch name)
 @jorisvandenbossche ah thanks ... I see it messes up the timeline a bit. I mistakenly pushed junk the first time and didn't want anybody to spend time on it.
