DT2W

These commits greatly improve doubletap-to-wake on the Nexus 4.

I've tried to separate each change in their own changeset so that it should be easier to review.