Json changes

Prepares the way for the new JHM implementation

Adds some helper functions to \<base/json.h>. Also improves performance considerably by reducing the number of copies, and improves error messages slightly.

There is a slight functionality change in the Match() helper. It now is more accurate with matching things (Before it was overly greedy in eating full tokens, which would occasionally cause it to eat an important comma as well).
Because it gives me a length. And all of it compiles away anyways with a modern optimizing compiler.