Fixed and somewhat finished LeaderBoards code

Fixed LeaderBoards code and somewhat finished it, although it is lacking
quite a few features to be fully ready to use.