Start porting settingd into js