Move endpoint (de)serialization to Channel.

This is a bit half-arsed for now, but it's a stepping stone.

(There are still some methods in Channel to be "removed", but that'll
require updating tests, etc.)

R=yzshen@chromium.org

Review URL: https://codereview.chromium.org/757373005