Update a bunch of newer code to be compatible with Python 3.

Since I initially went through and ported our code to Python 3, we've written a
bunch of new stuff. A lot of this stuff, especially the stuff that was done
initially on the release-1.7.x branch, didn't use the newer conventions for 2/3
compatibility. There were also a few lingering things that I hadn't ported yet
(like the `execfile()` call in rb-site).

Testing done: Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/5306/
Allow users to add or remove themselves to/from groups using the API.

Previously, there was no way for a user to add themselves to a group, or
remove themselves from a group. Only admins were able to do this. There
was also a bad query preventing adding on non-localsites.

Now a user can add themselves to any group they'd have access to, and
remove themselves from any group they're on. This works with both global
groups and groups on Local Sites.