extract display module; rename some locals
extract buffer module
formatting
add del key