Replace debugger with byebug in Ruby 2

The `debugger` gem hacks into the Ruby core and doesn't support Ruby 2
very well. `byebug` is a modern debugger that makes use of new APIs in
Ruby 2 for debugging. Also, `debugger` gem is broken in Ruby 2.1.2
(cldwalker/debugger#125).

Since `byebug` only supports Ruby 2, `debugger` still needs to be used
by Ruby 1.9.

There is no need to explicitly require the library as Bundler does that
automatically, unless specified as `:require => false`.

With this change, instead of calling `debugger` in the code to start the
debugger repl, call `byebug`. More docs at
https://github.com/deivid-rodriguez/byebug

Tested:
- Ruby 1.9.3, 2.1.1, 2.1.2
- manually using byebug to debug
Merge pull request #1462 from zhangsu/use_byebug4ruby2

Replace debugger with byebug in Ruby 2
Improve performance of grader-group assignment

Grader assignment to groupings are currently done in nested loops, so
each grader/group combination will issue a query to the database, which
is slow. This can be solved by doing a bulk operation in single queries.

The view also requires some fields that are not eagerly loaded in the
controller, which introduces n+1 query problems.

This patch improves the back end performance of assigning, randomly
assigning and unassigning graders, as well as populating the grader
index page. Assigning graders to criteria is still slow. The front end
is also super slow (it takes a few seconds just to check all the
checkboxes when the number of groups is over 1000!).

This partially solves #1443. The front end JavaScript also has to be
GREATLY optimized to fully resolve that issue.

Tested:
- rake test:units
- rake test:functionals
- local server testing
  - with
    - 2 assignments
    - 3 TAs
    - 1000+ students and groups
    - 2 * 3 * 1000+ = 6000+ TaMembership records
  - wall clock response latency is < 5 second for the optimized
    operations (only counting the back end, the front end can take more
    time than the back end to load)
Fix tests affected by modified parameter format

The query paramters for unassigning graders are changed from
<grouping_id>_<grader_username> to <grouping_id>_<grader_id>, so some
test cases need to be updated.
Add tests for Assignment#criterion_class
Add tests for update_assigned_groups_counts
Add tests for new class methods of Grouping