Eliminate unused locals and fn args

Just an exercise in finding and eliminating such things in a small
project using Eastwood lint tool, to see what it's like.