Renamed all base classes and implemented alloc and dealloc.