refactor JS out of index and add leaderboard