Feature/mongo 2.6.5 integration

Lots of fixes found during integration with other tools that are using this.
It's in a file called `matcher.cpp` but the class is actually called `Matcher2` so I think we should leave it. I think it's more consistent with how class names are used to name files everywhere else.