Fix a range of unicode errors
Convert notepad plug-in to new-style API