Leaderboard

Abstracted out most of the leaderboard functions from views/board.js to lib/leaderboard.js.

r? @cvan @mattbasta