Moved build_command_line back to kernel and make it handle Unicode