settings.js: Add missing 'unit' config variable
ecmascript: Add support for settings in legacy wrapper

Fixes #2300
Add example plugin for settings