cache a class with the extend module pre-included
use terrible hacks to make this work when rails tries to marshal