Apparently ORDER BY matters after a GROUP (which is surprising).
First stab at session script.
Merge branch 'master' of github.com:wikimedia/kraken