Update datastore to take optional ring filter. Fix replication and distriubted query bugs.

3 days of debugging pays off in glorious success! The ring filter for datastore is optional to have it filter what points get yielded by their location in the ring. This needs to be used when making distributed queries on a database whose replication factor doesn't evenly divide the size of the cluster.