Refactoring
Change As<std::string> to be able to take different allocator type.