Cleaned up lots of code

Changed allowed to functions in main.js
Commented code in app.’s for understanding
Added Toggle methods and changed index.html accordingly.