Add an automatic memory manager

Add Arena and Allocator to automatically manage memory. Users don't have
to deallcoate memory any more