Adding an optimized valid/invalid shares query

* This should speed up the process of finding shares for round and users

Addresses #246