Backspace functionality refactored into linenoiseEditBackspace() function.