Fix IE 10

Implement fixes suggested in #62 to support IE 10. Resolves #62.

Tested in Chrome, Firefox and Safari on Mac, IE 10 and 11 on PC.