Added temp var for langdef so the lines referring to it read a bit nicer. Reformatted changed functions with perltidy (tabs are gone now). Minor corrections to keyword regexes.