Further work on warnings.

- Warn on dead code.
- Warn on unmodified `var`s.
- Don't warn on unreferenced exported globals.
- Warn on empty if-statements.
- Properly warn at the correct place for immediate-assign hack
  functions.