Looks like a cool script! The problem though is that by including all the images inside the CSS you're forcing the client to download 3.62MB of icons, even if only a few are used.
You could avoid this by converting the emoticon text to <img> tags, or by conditionally inlining the CSS for the background-image. I'd personally prefer the <img> solution, though it's not as clean as the base64 solution as the images will need to be hosted as well.