Moved all declarations for default and max value to options.js
Imp: some codes to handle malfunctions that occur when settings are not defined yet