Refactoring to take advantage of lua syntactic sugar
Added more special character translations
Somewhat improved text output, still needs work though