Code style refined a bit
Add struct for memory block
Add class MemoryManager, fix compilation errors
Fix unit test and add remove function