(PDB-808) *DO NOT MERGE* fix paging for factsets

This pull request enables the full range of paging options on the /factsets
endpoint.
@kbarber this patch will currently error on the v3->v4-migration test in import_export_roundtrip.clj. I finally figured out the reason, which is that this query and the one for :facts above will break on facts/factsets with null-valued environments because they are trying to match null against null.  The test has been passing until now because the factsets query had not previously relied explicitly on "environment" IN "environment".

The reason environment is included in either of these DISTINCT clauses in the first place is that there seems to be no equivalent to Postgres's DISTINCT ON in HSQL.  The only functional purpose is to preserve environment as an accessible field for ordering; when combined with certname they provide not additional distinction.  Someone with better SQL chops than me may be able to rewrite it in a pg/hsql compatible way that doesn't rely on that.  Otherwise, we could represent the null environments internally as strings, or pass along environment IDs and use those, although that would require null environments to generate a non-null environment id, which they currently don't.

If there's no obvious alternative or good reason not to it seems to me like an internal string representation would be most painless.