Add some test cases to the memory pool
- fix any bugs that the test cases pointed out
- add to the general make file