Refactored app.js and moved some logic to toolbox
Merge pull request #175 from prabinv/29998_RefactoreAppJS

Refactored app.js and moved some logic to toolbox