Move most named results; return early and avoid unnecessary assignment when possible

In keeping with some of the comments on HN, I've removed named result parameters when possible and cleaned up a few other things. Test changes are only from running fmt. Tests still run green.