Misc cleanups and a new diff command.