Rewrote code to be cleaner, moved regex parsing

The Javascript side now does the regex parsing. You no longer have to go
inside a link to apply flair to it.