fixed some bugs in rankings module, new javascript

javascript is much better written now, but not perfect and still
has some bugs that I am working on. Norway!