Added error messages.
Added buffer.
Added missing line.
Added support for separate histories.
Added editline support.
Fixed input handling.
Moved everything into one file.