Treatment and coating of metals