event_logs: Reduce query expression duplication
Created by: efritz
Some of these expressions are hard to remember, so I'm going to define them in one place.
- our DATE_TRUNC usage works as expected for days and months, but for weeks we need to do some clock arithmetic so that it starts on sunday, not monday
- user id expressions are also a bit tricky and are repeated more than necessary