[vim] Make unescaping for strings a bit cleaner and more general.

adds escaping for '|' to bridge a difference between javascript and
vim regex flavors.

take the escaping a little lower level so that it affects '/' searches
as well, not just '%s/<regex>/<replacement>' searches.
[vim] Add flipEscaping

... so that '|' can be used as an OR in regular expressions or as a literal
character, depending on whether it was escaped or not.

1) fix the escaping of '(' and ')' in search expressions.
2) get the correct placement of the '\' in characters that need to introduce escaping.
3) change the capture unit test to expect that '(' and ')' should be escaped, as does real vim.