Fixes issues with charset moving

  - Charset would not be moved correctly with keepBreaks
  - Performance improvement due to previous method accumulating
    a large buffer in a RegExpi, which is really slow, especially
    when it would not actually find a charset declaration.

Adds failing test and fixes issue.