Package query_counter into its own file. @monde