function toJsonKey(obj) {
    if (Object.prototype.toString.call(obj) === "[object Object]") {
        var key = JSON.stringify(obj, replacer);
        if (key[0] === "{") {
            return key;
        }
    }
    throw new TypeError("Only plain objects can be converted to JSON keys")
}
Helper for getting a reproducible, key-sorted string representation of object.
Used to interpret an object as a falcor key.
@function
@param {Object} obj
@return stringified object with sorted keys.