More code review feedback.

- Made hidden settable
  - Updated hidden getter to take queued operation into account (so hidden
    get/set is more in sync (but there are still some cases where they
    won't be))
- Insteading of _pendingDisplayOperation being on the dialog, it's now
  passed between the states (since only a couple of states need this
  information).
Store dialog on state instances

Now dialog doesn't need to be passed into each call into a state.
Find high and low tab indices in 1 pass
Respond to tab index changes
Added comments explaining usage of promises in states
Highlight lines which use promises in an usual way
Hook up escape and hardware back button to hide
Eat pointer events and clicks
Fix multiple dialogs bug (beforeshow)

Multiple dialogs could be shown if .show() was called on a second dialog
during beforeshow.
Fix typo