Threading for rendering

Spawns a separate thread to handle the rendering