Putting back the memory warning callback and added dealloc method for some classes.