Move environment detection to before jQuery load
Fix emote function calling nonexistant replaceAll function, closes #1
Add automatic fallback when an emoticon function exception is thrown