factor summary stats logic out of view
push more permission checking up
summary stats API view, and cleanup of grades API views