bson: Change custom marshaling scheme

Custom marshaler and unmarshaler interfaces are
now changed so that they can work both as outer
object or embedded. The previous scheme only allowed
outer objects.
bson: convert custom marshalers to new API
bson improved tests

Also made slices more safe by setting their cap
so they don't accidentally overwrite other parts
of the buffer when appended to.
Merge branch 'bson'