Fixed issue #1162

Fixed #1162 - Incorrect normalisation of trailing spaces in <em> tags

Introduced a new more general version of normalizeSpaces which returns a 3-tuple. 
If there are leading spaces then the first item of the tuple contains [Space] and otherwise [].
The second position is equivalent to what was previously returned by normalizeSpaces.
normalizeSpaces is then implemented in terms of this new function.

Added tests to html-reader.html which pick up on this bug.