The port of mousetrap wasn't really what we needed. This is much simpler, matches the rest of our code, and does exactly what we need. Change-Id: I67f413e097fc2d4078336edb14dd9440e771f196