bug fixes & decreased JSLint complaints

Fixed two errors
1. an errant return data
2. textCodes was written as textCode in one instance

Code is more JSLint-friendly

There are still two JS-Lint complaints related to regular expressions that are just fine.

I did not have luck loading the Typo.js tests as a Chrome extension, so please verify them before merging.