Reorganized code to interact with BTrDB to simplify concurrency
Reorganized code to interact with BTrDB to simplify concurrency

SoftwareDefinedBuildings/mr-plotter,SoftwareDefinedBuildings/mr-plotter,SoftwareDefinedBuildings/mr-plotter,PingThingsIO/pt-mr-plotter,PingThingsIO/pt-mr-plotter,PingThingsIO/pt-mr-plotter,SoftwareDefinedBuildings/mr-plotter,PingThingsIO/pt-mr-plotter,PingThingsIO/pt-mr-plotter,SoftwareDefinedBuildings/mr-plotter,SoftwareDefinedBuildings/mr-plotter,PingThingsIO/pt-mr-plotter,PingThingsIO/pt-mr-plotter