Fix undo and caret behavior for :s.

In particular, undo after a :%s now properly undoes all substitutions,
and the caret is left at the line where the last substitution occurred.
When substituting, track start point in jumplist.

This means that `` will properly return you to the point you were at
before you ran the substitution. It also means that Ctrl-O will do the
same.
Rewrite ViTransformer to use matches.

Before we were iterating through the string; we now
repeatedly match through the string and update the range
as we go along to find the next match. We also skip to the
next newline when looking for the next match in non-global
mode.
ViTransformer can now provide the last replaced range.

This is an NSRange parameter that is passed in as a
pointer. When the method returns, the parameter has been
populated with the last range that the transformation
replaced.
Rewrite :substitute to properly deal with newlines.

We now do substitution on the whole file instead of linewise.
We preserve the proper functioning for /g, but also support
matching \n in patterns. Currently missing is the ability to
report the number of replacements and such, that'll be
coming back in a bit.
Add support for the /m regex flag in substitutions.

This is different from how vim does things, but there you
have it.
Add ViTransformer method to count affected lines/matches.

This method does a dry run of a transformation without
actually modifying the text, and reports back (via pointer to
NSUIntegers) the number of affected lines and
replacements.
Restore match reporting in :s command.

We broke this when we rewrote the transformation code to
accomodate newlines in the regular expression; this
restores it, leaning on the new ViTransformer match
counting method.
ViTransformer provides lines/replacements without a dry run.

The expanded version of transformValue:… now also takes
the affectedLines:replacements: parameters that the new
affectedLines:replacements:whenTransformingValue:…
method takes. This allows us to report the affected lines
and number of replacements even when actually running
the transform.
Always report affected lines/number of replacements in :s.

Before, :s only reported the lines and replacements when
provided with the /n flag, which indicated a dry run instead
of a true replacement. It now reports them even when the
replacement is actually run.

Currently there are some issues updating the status line
when the :s is not provided with the /n flag that indicates a
dry run rather than a proper replacement.
Don't hide messages set in this run loop cycle.

Before, the new ViStatusView hid any message that was
being displayed whenever a status component updated.
The issue with this was that sometimes in one go of the run
loop you would both have a status component change (e.g.,
a changed caret) and a request to display a message. In
these cases the component change would typically win,
making it impossible to see the message.

We now temporarily disable automatic message hiding for
the remainder of this run loop cycle when the message is
set, so that other status component updates won't hide
the message.

We also remove some code that was marked TODO from
the original status view refactoring that was related to fixing
this issue in the old code.
Fix an infinite loop in new transformation code.

Zero-length regex matches in the new transformation code
would fail to move the search range forward, so that the
same point would be matched repeatedly. This resulted in
an infinite loop both in the count-only version and the
replacing version of the :substitute command.
Properly consider ex range in :s command.
Merge pull request #45 from vicoapp/multiline-s-fixes

:s fixes/tweaks

 - Fix undo behavior for `:s`. Before undo would undo each substitution
   in turn, whereas we now properly undo all substitutions at once. This is
   more in line with vim behavior.
 - Fix caret behavior for `:s`. At the end of a substitution, the caret is now
   properly placed at the end of the last match that was substituted, or at the
   end of the file if nothing matched.
 - Fix jumplist tracking for `:s`. After a substitution, the previous location
   in the jumplist is now the place where you were when you ran the
   substitution command. This means immediately after a substitution
   command, you can use `''` or its sibling \`\` to return to the point you were
   at before you performed the substitution.
 - Fix newline handling for `:s` (this is the fix for issue #42). Newlines
   in the command will properly be matched. We also properly display the
   affected lines and the number of matches when the `/n` flag is provided.
 - Add support for the `/m` regex flag in substitutions. vim handles this
   situation differently, providing various ways to indicate you're willing to
   match newlines with `.` in the regex or whatever, but I'm trying not to
   deviate too far from more standard regex syntax if possible.
 - Report the number of affected lines and the number of replacements
   even when the `/n` flag isn't provided. Before you had to add `/n` to the
   end of the pattern to see the lines/replacements, but when you ran the
   actual substitution that information was not reported. It is now reported
   when you run the regular substitution as well.
 - Fix an issue where the new status view would not display messages if
   any status components changed during the same run loop cycle as a
   message was displayed. This would occur if, for example, a message
   was displayed during a command that also updated the caret (like
   `:substitute`). We no longer hide messages when a status component
   changes if that change occurs during the same run loop cycle as the
   message was displayed.