Major code cleanup. More generic class structure.

First swing at Dartcraft support.