Makes middleware compatible with Connect
Makes middleware compatible with Connect

- Checking for static resources verifies existance of req.accepts
- Call res.write and res.end when transformation is finished,
  instead of calling res.send.
- Updated JSDoc

Change-Id: Ia6edf4e57c8779954b5173bc2664ef3d194e93aa

ampproject/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,ampproject/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,google/amp-toolbox