Big refactor, borrow some code from PEP-3333 and werkzeug

- Don't set content-length if not set
- Don't wait until all body is ready and send it in a single write
  operation
- Handle exc_info in start_response
- Send headers before body
- Send date header