badges.js finished functions, converted mostly from pseudocode
Merge pull request #17 from AdrianMLin/master

badges.js finished functions, converted mostly from pseudocode