code format.
Some refactoring.
Small refactoring.
Matrix.settings second checking is added.
The function pushSettingsToHTML() is added.