app.js - code reformatted, some refactoring. All warnings (except 3) were fixed