JavaScript example: Remove reserved word detection

Reserved word detection as it was implemented in the JavaScript example
grammar had two big downsides:

  1. It required changes in ordering of choices in some rules in order
     not to trigger the detection prematurely. One of the changes was
     already implemented (in the |Statement| rule, see the diff), but
     apparently more were needed (the grammar didn't parse inputs like
     |true| or |function f() {}|). And I'm not 100% sure that would be
     the end of it (maybe deeper structural changes would be needed).

  2. It made error messages confusing. Consider the following example:

       var a = @;

     Instead of reporting:

       Expected ... but "@" found.

     the generated parser reported:

       Reserved word "var" can't be used as an identifier.

     This was because the parser parsed the statement first as
     |VariableStatement| and when this failed, it tried to parse it as
     |ExpressionStatement|, triggering the reserved word detection.

Because of these, I decided to remove reserved word detection from the
JavaScript example grammar.
PEG.js grammar: Remove reserved word detection

This is mostly done for consistency with the JavaScript example grammar,
from which the |Identifier| rule is taken from. See the previous commit
for details.
Mark |parse| and |SyntaxError| as internal identifiers

The |parse| function and the |SyntaxError| exception were meant as
internal, so let's mark them as such.
Expose the parser object in action/predicate code

The action/predicate code didn't have access to the parser object. This
was mostly a side effect actions/predicates being implemented as nested
functions, in which |this| is a reference to the global object (an ugly
JavaScript quirk). The initializer, being implemented differently, had
access to the parser object via |this|, but this was not documented.

Because having access to the parser object can be useful, this commits
introduces a new |parser| variable which holds a reference to it, is
visible in action/predicate/initializer code, and is properly
documented.

See also:

  https://groups.google.com/forum/#!topic/pegjs/Na7YWnz6Bmg
Clarify initializer documentation

Make it clear that there is only one initializer in the whole grammar.
The previous formulation could have been understood to mean that there
can be an initializer for every rule in the grammar.

Fixes #82.
Update example arithmetics.pegjs, make it work
Merge pull request #252 from chunpu/patch-1

Update example arithmetics.pegjs, make it work
Wrap initializer code in generated parsers into |{...}|

Initializer code is usually indented and this indentation is carried
over to generated code. This resulted in a piece of indented code in the
middle of the parser.

This commit wraps initializer code in |{...}|, which makes indentation
in generated parsers look a bit more natural.
Inline functions extracted just because of JSHint

Rather than extracting functions just because JSHint complained about
defining functions inside a loop, let's inline then and silence the
warning.
Standardize on 3 spaces before // comments
s/head/first/ & s/tail/rest/ in a testcase

Makes the testcase in sync with example grammars.
Change module exporting style

Modules now generally store the exported object in a named variable or
function first and only assign |module.exports| at the very end. This is
a difference when compared to style used until now, where most modules
started with a |module.exports| assignment.

I think the explicit name helps readability and understandability.
Utility functions cleanup: Split lib/utils.js

Split lib/utils.js into multiple files. Some of the functions were
generic, these were moved into files in lib/utils. Other funtions were
specific for the compiler, these were moved to files in lib/compiler.

This commit only moves functions around -- there is no renaming and
cleanup performed. Both will come later.
Utility functions cleanup: Cleanup lib/utils/arrays.js
Utility functions cleanup: Cleanup lib/utils/objects.js
Utility functions cleanup: Cleanup lib/utils/classes.js
Utility functions cleanup: Cleanup lib/compiler/asts.js
Utility functions cleanup: Cleanup lib/compiler/visitor.js
Utility functions cleanup: Cleanup lib/compiler/javascript.js
Fix a bug in |stringEscape|

The |stringEscape| function both in lib/compiler/javascript.js and in
generated parsers didn't escape characters in the U+0100..U+107F and
U+1000..U+107F ranges.