Adds Soy to JS code generation.

Also factors out some common test stuff into test-util.js.