added scoring and updated win/lose functions
refactored with lodash
Merge branch 'dev'