Refactor: app/models/stats/project.rb

- Extract all the SQL to their own methods
- Remove duplicity between Project#sql_projects_and_actions and
  Project#sql_projects_and_actions_last_30dayse