TokenAccums: Handle push, append via receiveToksFromSibling.

* TokenAccumulator push and append were handled differently and
  were adding tokens to the buffer which effectively treats them
  as being received in 'waitForChild' state which is buggy because
  the accum might have transitioned out of that state.  This can
  lead to tokens being lost since the buffer is ignored after the
  accum exits the 'waitForChild' state.

* Fixed the bug by treating push and append methods as equivalent
  to receiveToksFromSibling and using the tokens 'waitForSibling'
  state as the async state for the receive.

* This bug fix fixes lost-token-errors in the chunky tokenizer
  patch and eliminates the last of the async-related errors there.

* Left around from easy-debugging commented-out console.warn stmts.
  which should help us quickly see how tokens are progressing through
  the accum chains and cbs (at least helped me find this bug :-)).

* No change in parser test results.
* Verified errorless, diffless rting of en:Barack Obama.

Change-Id: I0400a941cb7a39d11072738681a5cce4587e82af
Merge "TokenAccums: Handle push, append via receiveToksFromSibling."
Tokenizer fixes for pre and nowiki parsing.

* pre_indent_in_tags production was incrementing the 'pre' stop
  late in the production but decrementing it if the production
  failed to match. This led to the stops counter going pretty
  negative (-5 in some cases) even when the pre-tags weren't
  unbalanced.  Fixed it by moving the increment as the first
  thing the production does.

* Split the nowiki production from 2 rules to 3 rules:
  - <nowiki> .. </nowiki>
     -- treated as nowiki
  - <nowiki />
     -- treated as nowiki with mw:Placeholder meta
  - unbalanced <nowiki> or </nowiki> tags in pre-context.
     -- treated as plain text with mw:Placeholder span tags.
     -- Fixed rule to explictly required stops.counter.pre to
        be > 0 (in case it is negative -- although not sure
        if this going to be the case anymore with the fix
        above)

* Minor syntactic fixes (added missing ; in a few places and
  replace foo['bar'] with foo.bar accessor).

* No change in parser test results, but there are diffs.
  in parser test output.  The diffs are all for the better and
  could result in more tests passing with other unrelated fixes.

* These fixes also brings the test results in the chunky tokenizer
  patch to parity with the a full-tokenizing-in-one-pass runs.

Change-Id: If3d461195431883c718d0becb3264fc270fdaf82
Use .item() accessor for DOM attributes.

Avoid using array-access notation for DOM attribute lists.

Also fixed up some instances where we tried to use array-access notation
to look up an attribute by name.  Use node.getAttribute() for this instead.

Change-Id: Idb38d07b6e56901860faa9a2c0f8ceadea09654f
Escape a single quote so we don't screw up emacs' syntax coloring.

Change-Id: I706eca7b0f44ac8d443a8d695e19a8f85667bb5d
Replace jsdom with domino, removing dependency on the native contextify module.

Domino is also reported to be faster, as it doesn't contain all the sandboxing
required to evaluate <script> tags in document context (which we're not using
anyway).

Use domino for all html5 parsing.

Update DOM version check for domino.
Remove html5 dependency (use domino parser/serialization instead).

Use domino to implement Util.serializeNode() and Util.parseHTML().
one optional assertion for domino correctness.

Change-Id: I2d61d37f97a031b83d93129597b11a3c4b91ccb3
Allow CORS requests so external apps (Nell's Wikipedia) can use this service.
API for a clean conversion from wikitext to parsoid-format HTML.

Just add 'format=html' to the parameters on your POST if you don't
want the textarea, etc in the response.

Change-Id: I49a3abb34e5c4ccbcfc3e7b41684b8d9adbc1c18
Bind server to proper port for AppFog deployment; add 'start' command.

AppFog uses the 'start' script to figure out how to run our app.
More AppFog deployment configuration files.