Fixing issues with the allocator and implementing extensive test
program.