Make log functions use format and vfprintf.
Basic gl/glx window and XEvent handling.