Refactored the renderer. There is no need to have two threads, one for
updates and one for rendering, so this change combines them both. It
also cleans up a few other pieces, renames a few variables and some
other housekeeping.