Backport #6677 Signed-off-by: Andrew Thornton <art27@cantab.net>
* split setting.go as multiple files * fix comments