fixed and optimized a lot of ns string checking and manipulation #548

Added nsToCollectionSubstring as well as static methods mirroring
NamespaceString methods.  This obviates the need to construct actual
NamespaceString objects in a lot of places, which is an optimization.

Also, went through the code and removed many instances of sloppy checking
of ns strings for things like "$" or "system.*".  Related to
[SERVER-8802](https://jira.mongodb.org/browse/SERVER-8802) and
[SERVER-8814](https://jira.mongodb.org/browse/SERVER-8814).