Ensure settings values are strings before saving

closes #2736
-reintroduces JSON.stringify for non-string values in
 api.settings.edit
-added a regression test