Combining/resolving Relative JSON Pointers in JavaScript