abstracted leaderboard

moved the leaderboard business code from one file containing functions
and layout into two layout and functions.

next step: abstract further to model/view/controller. at present models
and controllers are one and the same.
added the concept of an api key

added the concept of an api key to allow for the creation of a basic
api for export