JSON unicode fixes and running tests on invalid unicode JSON

Second try to create a pull request ...