json: Refactor the APIs

Refactor the `json` library taking feedback of @privat, @Morriar and @xymus into account. Also, correct some bugs related to JSON encoding/decoding and remove ad hoc escaping routines.

TODO: Support Unicode escaping.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
ah ok. dans ce cas la utilise des fences ~~~~ comme ca tu peux coller des
lignes blanches.

Autrement, c'est une limitation du parser markdown actuel (en attendant
#683). Je vais voir ce que je peux faire rapidement

On Wed, Nov 12, 2014 at 4:12 PM, jcbrinfo <notifications@github.com> wrote:

> In lib/string_cache/string_cache.nit:
>
> > +# using the API provided by this module to minimize their impact on objects
> > +# where they are unused.
> > +#
> > +# Here an example of how to use the provided API to cache the number of dots in
> > +# a string :
> > +#
> > +#     redef class String
> > +#     	# Count the number of dots.
> > +#     	fun dot_count: Int do
> > +#     		var dot_count = cache.dot_count
> > +#     		if dot_count isa Int then return dot_count
> > +#     		dot_count = chars.count('.')
> > +#     		cache.set_dot_count dot_count
> > +#     		return dot_count
> > +#     	end
> > +#     #
>
> À cause de la vérification des espaces.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/privat/nit/pull/907/files#r20251758>.
>