allow document classes to be serializable
references forcing has been little bit reworked, as for document module did