Add automatic reloading of configuration

This also switches back to daemon threads, makes `ThreadedSegment` spend even less times in locks and replaced pl.environ/getcwd/home with appropriate keys in segment_info.