generified bson macros type signatures

generated handlers matched some other BSON-related types but compiler
wouldn't agree due to sub-typing hierarchy. It needed some convincing
in terms of explicit type annotations.

this simplifies interaction between macros and collections