Move rating code to separate file. Small fixes.
Merge pull request #41 from BoShurik/master

Move rating code to separate file. Small fixes.