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.