Encode lists as json in Handler.write

In write/finish: treat `list` object as `json`. encode the list and set headers.