NH-3499 - Allow custom QueryModelVisitorBase to be provided through the session factory

Implements a new parameter on the session factory to provide a IQueryModelRewriterFactory which is used in QueryModelVisitor to allow the query model to be rewritten.