Added support for cache

This is a hurried implementation for a caching system. It increased my rendering speed by an incredible amount.