Fix conversion of non-paragraph content-containing nodes in sanitize

As it happens most browsers do a bit of sanitizing when you press
CTRL+SHIFT+V so this wasn't a real problem, but cleaning for consistency.

Also fix potential problem where the local cache of type wasn't updated
after a type conversion.

Change-Id: I8ffec4eedf7c4b5371c6443996be3d80fd5a0452