Doc resource refactor

This is required to "rebase" #194.

Please make sure to get #306 in first, so we can see if this passes tests.
yeah the above line should get merged down into the same set as the purpose of this section is "if mongos, we need to do some specific stuff"