coreutils: modernize and add test