Added thread to handle layer compositing. Modified GLContext to be multi-thread