Move out linkifyText, fix some bugs, and add unit tests.

This puts linkifyText into the RB namespace and into linkifyUtils.
There's now unit tests for all the important bits, and that'll set us up
for any future unit tests.

There are also some fixes to the /r/123/ links. Previously, a trailing
slash would be left off of the link, and encasing the link in <> (or
parens, or other things) would cause broken links. Now they're all
handled.