Extract `scaffold.js` for testing.

See #232.