Moving text functions to tedxt.js and moving event code into events.js