Fix sanitizing and some cleanup
Merge pull request #294 from jurriaan/richtext-fixes

Fix sanitizing and some cleanup