Make environment and datadir settings configurable