encoding/gob: support new generic interfaces in package encoding

R=r
CC=golang-dev
https://codereview.appspot.com/12681044
undo CL 12603044 / 2ca230b93195

fat fingers - did not intend to submit.
depends on the Unmarshaler CL anyway.

??? original CL description
encoding/xml: add, support Marshaler interface

See golang.org/s/go12xml for design.

Fixes issue 2771.
Fixes issue 4169.
Fixes issue 5975.
Fixes issue 6125.

R=golang-dev, iant, dan.kortschak
CC=golang-dev
https://codereview.appspot.com/12603044
???

TBR=golang-dev
CC=golang-dev
https://codereview.appspot.com/12918043