Avoid Math.sqrt() in ShakeDetector

Given both `magnitude` and `ACCELERATION_THRESHOLD` are positive, the following are equivalent:

    magnitude > ACCELERATION_THRESHOLD

    magnitude * magnitude > ACCELERATION_THRESHOLD * ACCELERATION_THRESHOLD

The second one is more efficient.
This comment is not useful as-is. Either remove it or say something like the first sentence of this PR description.