Moved Flash detection to JS

There are a few distinct but related changes here but they made sense to just tackle together.

Moved Flash detection (including Flash version parsing) into JavaScript.
Fixes #138.

Added new `deactivatedFlash` and `overdueFlash` events. These will be changed to an `error` event type in the future along with `noFlash`, `wrongFlash`, etc.
Fixes #255.