Fix `nodes` REST API to use correct version of wrapped queries

    When the `v2/nodes` endpoint was being used
    to wrap facts/resources queries, it was inadvertently using
    v3 of those.  This PR separates the code and tests out so that
    they each have their own explicit codepath, and adds tests
    that cover this issue (relating to `sourcefile` vs `file`, etc.,
    on the wrapped `resources` query).