file watching/recompiling, make threadsafe