Cleaned up undeclared variables.

- Removing all DOM calls from index.html
- Cleaned up indentation
- Cleaned up undeclared variables in functs