Specification of query for summarizing interactions

Quick implementation of the brute-force query that summarizes the data
we expect for Step 0. Beautification to come.