Factored out sanitization functions

Moved functions out of calamine into sanitize.js. Calamine is about
scoring and selecting the best element, not sanitizing or minimizing
html.