Add a 'stopall' option, rename the 'closewallet' option and related code to 'stopwallets', refactor the whole thing.