Set const-ness
Fix collision by simplifying the detection
Switch function into operator
Add stream operator
Remove logic from statistics
Add stream operator
Tests