function analyzeAndTraverse(analyzer, traverser, node, path, state) {
  if (node.type) {
    if (analyzer(node, path, state) === false) {
      return;
    }
    path.unshift(node);
  }

  getOrderedChildren(node).forEach(function(child) {
    traverser(child, path, state);
  });

  node.type && path.shift();
}
Apply the given analyzer function to the current node. If the analyzer
doesn't return false, traverse each child of the current node using the given
traverser function.

@param {function} analyzer
@param {function} traverser
@param {object} node
@param {array} path
@param {object} state