Misc. rendering optimizations

10-25% improvement on rendering speed. More to come later.