Improve db access (see notes)

* move aggregation pipeline management to own struct
* use different db ("dynamicvariables")
* fix "populate.js"
* simplify for-loop in dynamicvariables.go
Simply loop and db schema