Basic cleanup on config
Merge pull request #903 from darkwing/config-cleanup

Basic cleanup on config
fix bug 845890 - fix demo counts for staff users
(some) code cleanup
Merge pull request #905 from groovecoder/demo-totals-845890

fix bug 845890 - fix demo counts for staff users