Fix newuser and setpassword scripts, and port to idmap.