Fix some issues pointed out by eslint
I want to get to the point where we can run eslint as part of the CI pipeline: It'll catch some bugs, and to a large extent automate the pointing-out-style-issues bits of code reviews.
But before we add that, it makes sense to reduce the number of existing issues a bit. Here's a first batch, more to come once this lands ...