Fixed text file support and made language support easier for others to extend.