make sure that forward range is used in next_n
use vararg template to simplify stats
remove unused includes
update comments
don't depend on size() method being defined
small c++11 adjustment
no need to order keys
add value_and_tracker to make easier to follow