Adds an integration test for new-fact & get-timeseries
Refactor & fix update/query & range-where