Improve performance of StringStream with long lines (match)

StringString.prototype.match(<string>) may do a lot of unnecessary work:

  - If it is caseInsensitive it was calling toLowerCase on the entire string.
  - It did an indexOf search through the string for a pattern, but only cared
    if the string started with that pattern.

Because a string pattern has a fixed length, we only need to run toLowerCase
on a small substring of the stream, and we only compare this small substring
to the pattern.
[javascript mode] Recognize bitwise operators '~' and '^'

This was causing "1^2" to tokenize as: (number, "1"), (variable, "^2). By
tokenizing these bitwise operators as operators CodeMirror can correctly
syntax highlight the 2 as a number. Likewise the number in "~0".