Remove l10n strings from a deprecated function

See #173
Do plurals correctly for l10n

See #173
Remove an incorrect comment

Fixes #174
Merge branch 'issue-174'
Refresh user ranks when moving a rank in a group

1. When a rank is added to a group, we check if any of the users in the
rank in the position below it should be moved up to it.
2. When a rank is moved within the group, we first move users to the
rank directly below it. Then, after moving it, we check if any of the
users of the rank that is now below it should be moved up to it.
3. When a rank is removed from the group, we check if there is a rank
below it. If so, we assign users with the rank being removed to that
rank. If not, we delete those rows completely.

See #155
Update user rank func: improved base rank handling

When updating a user’s rank, we have to account for the fact that when
users have a base rank, they currently don’t always have an entry in
the database. Because of that, we can’t rely on an update query to
modify the user’s rank; sometimes we need to run an insert instead.

We were doing this, but we were making the assumption that if the user
had a base rank would always need to do an insert. However, now
sometimes the user’s rank will be in the table, so we need to fall back
to the usual update query.

See #155
Add a function to get all users with a rank

This is needed for refreshing user’s ranks by rank.

Includes unit tests.

See #155
Add a function to refresh users' ranks by rank

This function checks if there is a rank below the one being refreshed.
If so:
1. It gets the users who have this rank and checks if any of them
should now move down to that rank.
2. It gets the users who have that rank and checks if any of them can
now move up to this rank.

See #155
Import $wpdb global before attempting to use it

See #155, f3e0d02a14c010d4d87ac9a444f43555716b38b4
Add a new rank to a group after adding its meta

Rank groups now automatically handle refreshing user ranks as a rank is
added to them (f3e0d02a14c010d4d87ac9a444f43555716b38b4). If this is
done before the metadata is added, it defeats the purpose, because the
metadata is what determines whether a user can hold a rank.

Includes unit tests.

See #155
Recheck if users can hold a rank when updating it

When we update a rank, it is possible that users who used to hold the
rank cannot any longer. When the update means that the rank’s group or
group position is being changed, this is automatically handled by the
group classes (f3e0d02a14c010d4d87ac9a444f43555716b38b4). But, in order
for it to take into account the updated metadata, it needs to happen
after the metadata is added. So we switch the order there.

Also, the metadata can be changed even when the rank position isn’t.
This needs to be handled separately, using
`wordpoints_refresh_rank_users()`.

Includes unit tests.

See #155
wordpoints_get_user_rank() says it returns an int

And now it does.

Fixes #177
Declare a private function was private

Not public. That helps.

Fixes #178
Remove extra newlines

See #155
Bail early if no users to loop over

See #155
Use %s so translators don't translate %points%

This placeholder (`%points%`) is used in the My Points widget, and is
not translatable. It must remain exactly like this to be usable.
Replace it with the `%s` placeholder in the string so translators don’t
accidentally translate it.

See #173
Update language files

See #173
Merge branch 'issue-155'
Merge branch 'issue-173'
Merge branch 'master' of https://github.com/WordPoints/wordpoints