Moved operator<< out if anonymous namespace
Added performance tester
Replaced pointers to copies, indexes to iterators