Codewar's style ranking system algorithm JS implementation with jasmine tests