code: function getCommonBaseDir(a, b) {
  	var common = [];
  	a = a.split(path.sep);
  	b = b.split(path.sep);
  	for (var i = 0; i < a.length; i++) {
  		if (b[i] === undefined || b[i] !== a[i]) {
  			break;
  		}
  		common.push(a[i]);
  	}
  	return common.join(path.sep);
  }
docs: Finds the base dir common to two paths.
  For example '/a/b/c/d' and '/a/b/c/x/y' have '/a/b/c' in common.
  
  @param {string} a - path a
  @param {string} b - path b
  @returns {string} - the base dir common to both paths