Code cleanup, added expose event redraw, fixed high CPU with
large delays, re-wrote text display functions, changed ESC key
to exit, made delete key clear buffer, added support for shift
modified key entry into buffer, fixed previewSurface leak.