WTS: Code cleanup.

* Mostly minor code cleanup.
* Removed some dead code.
* Refactored some repetitive code.
* Assumed that node passed into serializeDOM call is a body-node
  that lets us kill checks for body in a couple places.
* Added identical comment serialization code in all places a comment
  was being serialized.
* No change in parser test results.

Change-Id: Iba36d5924eb145ec10e8932db0756cd2a3847967