Prevent tab focus from leaving dialog, fixes #3

Just closing out some of the modality support. I've tested on FF, Safari and IE10 (back to IE8 mode).
(There's a few TODOs, but the behaviour to fix them is too complicated for this first pull request).
Nope, apparently not. I was a bit aggressively trying to convert it to a number - I've changed it to-

    span.tabIndex = tabIndex || 0;