Greatly sped up writing rankings to file

Also caught a bug on rankings refreshing