GROOVY-6822: Rewrite the JsonBuilder implementation