Updates to fix minute-level aggregate queries in Postgres 9.3. Also improves query performance by removing joins.