Several preparatory changes and cleanups to switching to the day by day score calculation

- Make the score component calculation accept an input range so that we can
  predict the scores for existing users
- Converted the components to relative values (ratios) to make it more fair
- Define a calcScore function that combines the components into a single score
- Comment out an extraneous debug statement
- Optimize getFootprintCompare to reduce the number of queries to the database.
  We were calculating various distances for every single footprint calculation scheme
- Make the classifiedRatio work for a range as well
- Updated the test cases to work with the percentage values, and the range based pctClassification
Define a "score" field in the user profile to maintain a stateful score that can be updated

Define the function to update it in gamified, and add a test case for it as
well. Note that the score field should really be refactored out from the user
profile since it applies only to the gamification client. The refactoring is
deferred until a bit later, when we have a better idea of what the use cases
are...
Fix stupid bug in the client creation script

bool(String) doesn't actually convert a string to a boolean.
So we were creating a new ID even if the user typed in "False".
Fixed with a simple boolean check instead.
Created the new result screen

- It uses the d3 bullet graph type to display:
    - the current score
    - the previous score
    - the three levels

- It was pretty challenging to get this to work vertically.
  In the end, I used the example here:
    http://www.jasondavies.com/bullet/

- I also had to spend a bunch of time getting the log scale to work - in
  particular, the default bullet.js used value - scale(0) to determine the
  length of the bar, which doesn't work with the log scale. I need to send a pull
  request for that.

- bullet.js also contains a hardcoded log scale currently, although I am pretty
  sure I know how to change it. But the higher priority is to hook everything
  else up with the correct values
Couple of small fixes to the rest of the code

- add support for static files served up from the client subdirectory to
  support client specific javascript
- scale up the values by 10 to allow people to see their progress more quickly
- ensure that the score is never negative
- remove the unused variables from the template
Hook up the gamified UI to real data

- Print the axis ticks using 100k notation instead of 100000 to make it more
  readable, and shorter to boot
- Adjust the margins so that the score bar is not right in the middle of the picture
- Changed the user module to store both the current score and the previous score
- Changed the gamification module to hook up both scores and the image file name into the template
- Changed existing test cases and added a new test case
Fix some minor formatting issues

- Check in d3 to allow us to work locally
- Change the margins so that they work properly
- Change the result template to change the ticks to lightgreen to match the text
Merge pull request #17 from shankari/master

Fix the script that collects data from moves
Check in proposed changes to the consent document
Change the document to include links to github
Change the images to be in portrait mode instead of landscape

So that they can be displayed correctly on the phone
Merge pull request #19 from shankari/gamification

Calculate score and display it as a progress bar
Trim the pictures so that they fill up the screen

Remove margins so that we don't get an unsightly border around the screen
Check in support for submarkers

This allows us to identify the points where the picture will change, in
addition to the levels.

This version of the result template is also scaled correctly and displays the
correct bar on the side

Checking in this working copy before I start mucking around with the popup
Add a button that pops up the game rules

The goal was to have the rules popup when the screen was launched, but that
doesn't appear to work in the phone webviews using jquery mobile. I can try
a different framework (ionic), but let's finish everything else end to end first.
Last few UI fixes

- Remove the alerts
- Remove the code to check whether the popup has been displayed earlier and
  popup on start since it doesn't work anyway
- Fix some typos in the text and change the text titles to fit better
Merge pull request #20 from shankari/gamification

Bunch of cosmetic tweaks to the gamification UI
Add .DS_Store directories to the .gitignore

This is "a hidden file with a proprietary format created by OSX to store custom
attributes of the folder".
http://en.wikipedia.org/wiki/.DS_Store

It does not need to be checked into source control!
Background process to compute client-specific result scores

This has the following main components:
- A new method for the plugin architecture "runBackgroundTasks"
- Implementations of the new method for the clients we have so far - gamified,
  carshare, and testclient
- A new top level script that invokes the background tasks to precompute results for all users
- A default implementation for users who are not part of a client

This allows us to replace the carbon footprint calculation in the default data
view with a precomputed result as well.

Couple of other things to note:
- I also moved the client count from User to userclient since it deals with both user and client
    - Updated unit tests to handle this
- Added a new unit test for the background invocation
- Documented the design decision for future reference
Merge pull request #25 from shankari/gamification

Background process to compute client-specific result scores