Better debounce handling (draft)

See

 * https://learn.adafruit.com/tilt-sensor/using-a-tilt-sensor
 * http://arduino.cc/en/Tutorial/Debounce