Use toHTML vs. instanceof checks for SafeString

Allows for us to play nicely in environments such as Node that could have multiple versions of the library loaded. Also allows for implementors to provide their own behavior, provided they know what they are doing.

Fixes #886
Merge pull request #890 from wycats/to-html-safe

Use toHTML vs. instanceof checks for SafeString