Add a global property controlling whether or not GUI functions are enabled

Also, if we try to create a QApplication, and fail, fall back to a QCoreApplication (this is untested, hopefully it will allow graceful degradation if br is run somewhere with no windowing system enabled).