Support streaming similar to resources with facts

This PR is a rebase of a @grimradical (PR)[https://github.com/puppetlabs/puppetdb/pull/634] to work with the paging stuff in master from 1.5.0.  I tried to make this change minimal and follow the resources pattern.  As a separate effort, I'd like to get the logic around both of these pieces pushed down to where it's more reusable.