Fixed a few link detection bugs.

I moved the two link detecting functions -- one for normal links and one
for native chatrooms (e.g. /heyman) -- into jQuery plugins for easier
iteration over each element.