Added statistics functionality, also export DB to SDcard
Merge branch 'master' into demo
Fix R package