More efficient smilie replacing (see pull request #291)

I ran a little benchmark to make sure this improved things, and it looks like it does: about15% on encode only, 5% on encode-decode. I also removed the anonymous function I had introduced, that can't hurt I guess.