Added GameThread class, that allows checking whether the current thread is the main thread, and submitting processes to run on the main thread.