Added engine_refresh function.
Replaced clean_canvas and draw_sets calls with engine_refresh call
Added window_event_wait function.
Added engine_input_wait function.
Polls for events from STDIN and X now.