Avoid external dependencies

Little rewriting to avoid non-coreutils dependencies like vim (for xxd) and sed.