some tidying up
fixed mid token tag behaviour

now if text is tagged mid token (e.g. “N=<n>33</n>”) the whole token
will be tagged (“N=33”, “n”)
more tidying up