Finished rating functionality.

I'm going to test the pick algorithm, but I think I'm done.
I made some stupid mistakes, but testing fixed them.
Merge remote-tracking branch 'origin/rating' into rating