Simplified the template interface; some code cleanup; added Allocator template parameter; work-in-progress;