Bring over clean paste logic from webapp

consolidate cleanup functions

Checks for google docs, inter-editor, and some random webpage sources for paste cleaning

use document fragment for the span cleanup (issue #html)

inline html pastes

cleanup
Merge with origin master