Refactored to use document.execCommand, where supported.
Added demo page
Merge remote-tracking branch 'origin/master'