Restore snippet handling in completion, drop space as accept.

The real culprit was that space accepted the completion
instead of ignoring it, which doesn't make sense as you
type. For now, removing space as an accept action.
Add autocomplete option in preference pane + default to YES.

We're going to try a proper implementation of complete as
you type, which will involve slightly differing behaviors for
the completion popup depending on which mode it's invoked
in, so we need this preference in place.
Apply completion aggressiveness flag everywhere.

We missed a spot, so depending on the path you took the
completion controller could still aggressively choose to
close the window based on only having 1 completion, even
if completion was initiated in a non-aggressive way.
Pass keys from completion controller to text view as well.

We pass in the text view's key manager when initializing
the completion controller, and it goes on to pass keystrokes
back to the text view. This way, we're updating the contents
of the text view as the user types, in addition to filtering the
completion view itself.

This replaces the old
completionController:appendedStringWithoutCompleting:
hack, which was totally broken anyway.
Trigger completion window based on autocomplete preference.

We also only trigger it once at a time. So if the completion
window is already up, we don't try to bring it back up, which
will reset its state. Instead, we track if we've currently got
a window up (which is easy since it runs modally) and don't
try again until it's gone.
Move check for whether completion window is up.

We now check in the central presentCompletionsOf: method
instead of checking only when checking the autocomplete
trigger, since we've changed how completions work in
general. We also update the flag in presentCompletionsOf:
as well.
Make space accept only if not autocompleting.

We add a selector, accept_if_not_autocompleting:, to
the completion controller. When invoked via autocomplete,
the completion controller gets a C option, which we check
for and then set on an instance variable. That variable is
then checked when invoking accept_if_not_autocompleting:
to see if the selected entry should be accepted or not.

The effect of this is that invoking autocomplete via C-N will
accept on space, since you explicitly asked for the
completion popup, while if it pops up via autocomplete it will
only accept on enter/tab. The additional effect is that this is
customizable behavior -- the relevant keys can simply be
remapped to accept: or accept_if_not_autocompleting:
as desired.
Properly set the completion range after it's selected.

Now that we're filling in keys to the text view as they're
being procesed by the completion controller as well, we
need the range to reflect the fact that all prefix/filter text in
the completion controller needs to be replaced with
whatever completion was selected.
Replace complex NSInvocation with a regular message send.
Strip handling of terminating key in ViTextView.

Because all keys are sent to the text view anyway, there's
no reason at all to handle the terminating key after the
completion popup goes away, as it's already been handled.