Fix association of modes with tokens for addModeClass

The mode associated with a token is now the inner mode at
the time when the token is started. The htmlmixed and markdown/gfm
modes were fixed to return empty tokens during mode switches
when necessary to enforce this rule.

Issue #2919