Large amount of work on expanding the capabilities of the bufwin and tidying up the code surrounding it. The main element added is a fix of a seg-fault when writing to a newly added line that caused the screen to scroll