Fix json parsing
Github Issue #32 (closed).
Decoder crashes on:
{"test":[4,3,2]}}
{"test":[4,3,2]},
due to assuming that we will always get valid JSON. This commit fixes these class of bugs of trailing characters and incorrect braces. I am sure there will be more of these bugs in the future.