Refactoring the linenoise library.