JsonSchemaTree: add a .setPointer() method

This method changes the context starting from the base node again.

Also factorize and simplify the code.

Signed-off-by: Francis Galiegue <fgaliegue@gmail.com>