Adds caching and singleton behavior to dynamic types