Convert TEITags extension to work with MW 1.20.2

Minor improvments and refactoring