Improved Settings class

Also fixed some jshint problems.