Merge pull request #2 from wayferer/master

Add support for IE8
Tidied up code after merging IE8 changes in
Merge pull request #1 from euangoddard/master

Update from original