Add timeout in ReadKey for event processing

The pipeline thread is blocked when PSReadline is running.
When the pipeline thread is blocked, PowerShell won't process
any events.

I added a timeout of 300ms and check for event subscribers,
if there are any, then run a bit of useless PowerShell so that
the PowerShell engine will get a chance to process events.

Fixes #133.
Remember script block for custom key bindings

For various reasons, we may need to know that a key binding
came from a script block so that is now saved in the key binding.
Tweak yielding for event processing slightly

Based on feedback from Lee, the conditions under which
we need to pulse the pipeline can be even more restrictive
and a more minimal "useless bit of script" can be used.
Reset console mode for calls to external code

For an unknown reason - SetConsoleMode calls fail when setting certain
modes.  One such case is when PowerShell calls SetConsoleMode in it's
implementation of PSHostRawUserInterface.ReadKey.

PowerTab calls this method - and it's possible that other custom
key handlers might want to use that api, so I will reset the console
mode to what it was before calling PSReadline for the duration of
the external code (tab completion or custom handlers) and reset it
when the external code completes.

Fixes #125.
Better multi-line editing

These changes provide a more seemless editing experience when
the command input has multiple lines.

The history recall functions now avoid recalling history if the
input has multiple lines _and_ we aren't in the middle of
recalling history.  If you do want to edit a recalled multi-line
line (ugh) then you can first use something like LeftArrow then
UpArrow will work like you would want.

BeginningOfLine/EndOfLine have been changed as well.  If you're
already at the start/end of a line, you'll go to the start/end
of the input, otherwise you'll go to the start/end of the line.

Two new functions have been added for moving up/down lines in case
somebody wants to bind those independently of history, but I don't
see those being used much.

Fixes #47
Clear emphasis if any before accepting a line.
Update changes.txt
Fix MenuComplete to properly clear the menu