Optimizing rare variant association studies in theory and practice