Move Settings from viewer.js to its own file
Fix coding style and improve comment in settings.js
Merge pull request #3757 from Snuffleupagus/move-Settings

Move Settings from viewer.js to its own file