Refactored the Weird Twitter code and added variants for Japanese text, CJK ideographs, and math.