Allocator helper class started.

Convert some method to functions (it is more scalable).
Some minor fixes.