[mongo] define bson_iterator_subobject_init to work with the older c driver
new versions of bson require we destroy the subobj iter
start of refactor for autodiscovery of nodes

 * does not yet compile
add dynamic database detection and other refactors

 * compiles again