New rest api and db functions

Also added distinct function to get unique values
Minor
minor
Added aggragate function
(for grouping by some parameter, useful for getting scrolls in groups by user)
changed the way PUT gets criteria
A bit of deletion, refactored, and updated gruntfile
Minor update, fixes for heroku
Merge remote-tracking branch 'origin/master' into mongoDev