Synthetic cassettes for pH-mediated sensing, counting and containment