Added insert support. The document seems to change in between however and the getSelection returns null. Try to fix this.