Add ResultFactorySet interface and default implementations.

This makes it possible to use different ResultSet implementations when
using a distributor.