used index.html for testing textarea input; changed name of some vars and methods, re-ordered escape character handling to fix a bug