(bug 52799) Filter JSON dump by shard or type.

This introduces filtering based on entity type, as well as sharding
based on ID hash.

Change-Id: I402a333f71db96b56f9c04ea2b24807abb303280