getObjKey = function (obj, key) {
    var innerobj = obj;
    var keyparts = key.split('.');
    var subkey = null;
    var arrayMatch = null;
    var reArraySingle = /\[([0-9]*)\](?:\.|$)/;

    for (var i = 0; i < keyparts.length; i++) {
      if (typeof innerobj !== 'object') return null;
      subkey = keyparts[i];
      arrayMatch = subkey.match(reArraySingle);
      if (arrayMatch) {
        // Subkey is part of an array
        subkey = subkey.replace(reArraySingle, '');
        if (!_isArray(innerobj[subkey])) {
          return null;
        }
        innerobj = innerobj[subkey][parseInt(arrayMatch[1], 10)];
      }
      else {
        innerobj = innerobj[subkey];
      }
    }

    return innerobj;
  }
Retrieves the key identified by a path selector in the structured object.

Levels in the path are separated by a dot. Array items are marked
with []. For instance:
 foo.bar[].baz

@function
@param {Object} obj The object to parse
@param {String} key The path to the key whose default value we're
 looking for. each level is separated by a dot, and array items are
 flagged with [x].
@return {Object} The key definition, null if not found.