Bug fixes; test coverage improvement

- Removal of dead code
- Improvement of test coverage of non-grammar JS to >90%
- Fixes issue #12