Enhance daemon code, tests and add .nvmrc support