Refactoring.
Added rank attr to teams; added some missing indices to the users table.