function getValueByPointer(document, pointer) {
    if (pointer == '') {
        return document;
    }
    var getOriginalDestination = { op: "_get", path: pointer };
    applyOperation(document, getOriginalDestination);
    return getOriginalDestination.value;
}
Retrieves a value from a JSON document by a JSON pointer.
Returns the value.

@param document The document to get the value from
@param pointer an escaped JSON pointer
@return The retrieved value