Fix pasteHook and add ability to toggle rich or text paste
Merge branch '1.x' into gh-pages