Improve forums performance

Now with fewer globals and less redundant computation! And more unit tests!

@jimabramson