size tests
simplify serialisation of JSON into string-buffer