Add new aggregation type support to PowerDatum queries.
Bump up default max results to 1000 (more reasonable).
Add comments in SQL for clarity.
Add more comments.