Rewrite TabCompleteBehavior

Started rewriting TabCompleteBehavior using code from the web client.

Separate tab completion into two event handlers: KeyUp and KeyDown.
Matches should be generated in the KeyUp event, while actual tab completion should be done in KeyDown.
Fix TabCompleteBehavior problems due to differences between .NET and JS

- CaretIndex can not be less than 0
- Substring function requires the length of the slice
Merge pull request #20 from coldstorm/tabcomplete

Implement tab autocomplete