CLJS-852: Faster group-by

Copy over the Clojure implementation which uses transients.