Added more sanity checking

The Postgres dump code now checks its assumption that the IDs provided to it by Postgres are in non-descending order. Also, removed a sort on tag keys which was unnecessary and more work which isn't in the tags tables' indices.