Optimize render loop. Closes #100.