Added new tests and refactored update and render loops.