Improve smilies scanner and put code to template file.

I changed the SmileyHelpers a bit with Regex, because the old code does not work correctly with some text like this: "expansion", "5:35 PM" (because we're using a simple gsub, and it just replace **xp**, *:3*, ...)

The code is now rather big, so I moved it to a ruby file in `templates` folder.