Refactor readerTools.js

Includes fix for some failing JavaScript tests.
Also found the source of problem with word list (BL-599), but the fix is not included in this pull request, because the bug is in the SynPhony code.
No, javascript does not require braces when the "if" statement is just a single line, similar to C#. And this file is now generated from the typescript file.