Committing changes:
* Unit tests now all pass.  For keymap tests, I force "emacs" mode to
  be on by default, regardless of if a .inputrc exists.  For
  ConsoleReaderTest I had to do a horrible kludge to keep .inputrc from
  being read, as it appears its mere presence breaks the test.
* I added the start of a new test suite for vi "move" mode.
* I have started going key-by-key through the vi movement commands,
  testing and fixing them.  Of note, you can now properly transition
  between move and insert modes and hitting enter will now re-enter
  insert mode.  I haven't gotten too far...I'm still on the CTRL-?
  keys in move mode.
* The Configuration class looks like it was supposed
  to be a singleton but wasn't.  If you pass null into getConfig()
  now, you get the most recently created configuration.
* All KeyMaps have the arrow keys bound now, not just emacs.
Addressing code formatting and various minor comments from jdillon
More minor code formatting/comments.
More 'vi' improvements around movement and CTRL keys
- History movement in vi mode will leave the cursor at the beginning of the line
- CTRL-T to transpose characters now works
- Unit tests for ENTER as ^J or ^M
- More tests for ^K
- CTRL-L (clear screen) tests. There are some questionable results here
- Tests for history movement with CTRL-P and CTRL-N
Oops. Minor code formatting change.
It is tough to switch styles throughout the day.
More 'vi' unit tests. Added JVM shutdown hook to restore the terminal.
Revert "More 'vi' unit tests. Added JVM shutdown hook to restore the terminal."
I missed the fact that the terminal already has a shutdown hook. Researching
why it isn't working for me instead.

This reverts commit 716bdf7d405e6daf1cc1d0191de6847dade04a20.
More "vi" key support/improvements:

- Very crude support for picking up variables set in the .inputrc
  This really really needs to be its own class (e.g. InputRcParser)
  and needs some real processing of input.  But, another time.
- Added INSERT_COMMENT and VI_INSERT_COMMENT support that should
  follow readling behavior pretty well.  Added set/getCommentBegin()
  in ConsoleReader to help support this and recognize the .inputrc
  begin-comment setting. Unit test for basic support.
- Property implemented UNIX_WORD_RUBOUT to follow readline behavior.
  Unit test for CTRL-W invokation.
- Unit tests for CTRL-U (line discard), space (move next char),
  and CTRL-M (another form of enter).
Have paren matching working now + unit test.
Vi-search mode ('?' and '/') is now working.
I need to add additional unit tests for it.
Implements vi history search ("/" and "?").
Added "vi" move argument support.
Commands in move-mode that allow a repeat count
Currently I have many of the currently functional operations
supporting it, but need to review them. Also, I should create
unit tests every command that supports it.
Added ESC disambiguation (literal ESC vs. a terminal sequence)

This change allows jline to tell the difference between a
literal ESC (the user hitting the ESC key) and an ESC that
is part of, say, a terminal control sequence.  This is done
in the same way that vi does it: when an ESC is encountered
we wait for a short period of time (150ms -- controllable by
jline.esc.timeout) to see if another character is coming. If
one isn't, then it is a literal ESC, otherwise we follow jline's
normal behavior.

The one note-worthy introduction of this code is a new thread:
Standard java I/O doesn't have the ability to peek into a stream
in a non-blocking fashion, so this peeking is performed by
a separate thread which will block indefinitely until the byte
is read. The thread is only started if jline.esc.timeout is
a positive value, so it can be disabled with this setting. The
thread is only active immediately after an ESC is received
in which case it is responsible for reading the next keystroke.
After that keystroke is read, all other reads happen in the
context of the main jline thread.

There is a new shutdown() method on ConsoleReader() that shuts
the reader down and, more specifically, shuts the helper thread
down.  Also the ConsoleReader() has a finalizer that should
shut the thread down if it gets cleaned up.
Implemented: VI_RUBOUT,VI_DELETE,VI_CHANGE_CASE,
VI_PREV_WORD,VI_NEXT_WORD,VI_END_WORD
Also the NonBlockingInputStream has been updated to allow
the I/O thread to be shut down, but the class will continue
to function.
Comments. "vi" maps to "vi-insert".
ConsoleKeys is now the one-true-source of keymaps.

While it was possible to set the current keymap, it
was almost impossible to find out what the current keymap was
and there were all sorts of places where the tracking of whether
vi mode was active or inactive was broken.  This change centralizes
all of this in the ConsoleKeys class.  KeyMaps can now be set
and retrieve by name and a map knows its name and knows whether or
not it considered a "vi" keymap, making it almost impossible to get
wrong.

I also exposed API's in ConsoleReader() so that the client can
switch between keymaps (this was necessary for better jsqsh
integration).
Added changes suggested by jdillon.
vi:All delete-to,change-to,yank-to operations added

This adds almost all of the missing vi features
- Delete-to (e.g. dw == del word, dd == del line)
- Change-to (e.g. cw == chg word, cc == chg line)
- Yank-to (e.g. yw == yank word, yy == yank line)
- Put (to put the yanked test)
- Replace char ("r". e.g. "r." replaces the current
  char with ".")
- Char search ("f","F","t","T",";",and ",")
  including combinations of delete/change/yank-to
  (e.g. 10dfX will delete to the "X" character 10
  times). This also includes the rather complex
  behavior of ";" and "," with regard to reversing
  the search direction.
- Lots of new unit tests for the above.  I still
  have some work to do to cover the combinations of
  the *-to operations.
setCursorPosition(0) was returning false. No good.

Small fix due to the fact that setCursorPosition() to the
position that the cursor was already at was reporting failure.
Shutdownhook is enabled by default now.