Refactor rendering code

This makes the rendering code serial instead of parallel since it now just dispatches commands to the GPU.

It also adds some more profiling data.

r? @pcwalton