Fixed typos.
Added some tests.
Bugfix for bug caught by tests.
Implemented escaping within span elements.