Moved graphics to its own thread and setup input class.