Use strict (in)equality comparison operators, other various cleanup

I stripped the parentheses from the `typeof` calls, as that seemed cleaner to me, though I can easily modify all of them to use parentheses instead. I've also made some other cleanup/fixes, such as whitespace fixing and using Regex literals.