More Javascript module documentation.
Add Javascript to chapters.
Add a pandoc filter to create compatible html.
Not a real change.

Using a macro to reset JSEmitterStates for the sake of readability.