Reformatting.
Fixed HTML Escaping.
Added unit tests.
Logic changes following unit tests.
ToValue instance for strings/textValue function (for disambiguation).
Documentation and error message improvements from unit tests.