Add more strictness

- More `"use strict";`
- Use `===` and `!==` where possible
- Compare with `undefined` instead of `typeof x === "undefined"`
- Remove unnecessary `else`
- Define globals