Preparation for non-blocking mode.
Bug fixes, added bash-like completion with hints.
Added signal handling.