Test generic printing of expressions that require parentheses.
Implement a simple Path type for tracking child-to-parent relationships.
Use the new Path type to keep track of child-to-parent relationships.

We can't just store a .parent property on AST nodes because a node can appear in multiple places in the AST, with different parents.
Add parentheses in genericPrint according to path.needsParens().
Handle UnaryExpressions in Path.prototype.needsParens.
Handle simple BinaryExpressions in Path.prototype.needsParens.

Dealing with precedence will come later.
Handle {Assignment,Conditional}Expression in Path.prototype.needsParens.
Handle numeric member expressions in Path.prototype.needsParens.
Handle BinaryExpression operator precedence in needsParens.
Parenthesize statement-initial {Function,Object}Expressions.

This avoids ambiguity as to whether the "function" keyword begins a function declaration or function expression, and whether the "{" begins an object literal or a block of code.
Return early from needsParens when path.node is not an Expression.
Parenthesize sequence expressions only when path.needsParens().

Previously, just to be conservative, we always put parentheses around sequence expressions.
Be smarter about parenthesizing NewExpression callees.
Avoid calling getReprinter on paths printed by a previous reprinter.

Besides being a slight performance win, this ensures that reprinted nodes are always printed generically at least one level deep.
Detect missing parentheses when reprinting.

As the included test demonstrates, it is possible for the same node to appear in multiple places in the AST, having need of parentheses in one position but not another.
Merge pull request #26 from benjamn/parentheses

Insert parentheses where necessary