JS performance optimizations

Made Rect handle its own pool, so Chrome can optimize it.
Changed cell groups to use new ArraySet, so they don’t have unoptimized
for-each loops in Chrome, and to make iteration-and-removal faster
regardless.