Add a few comments and move around some code

IOUtils still feel unpolished, but adding quick comments to everything
makes it seem nicer.