A Model for Learned Bloom Filters, and Optimizing by Sandwiching