json: add tests and fix integer and rationnal parsing