Implement the functions unit and unitless (#12777, #12778).

Change-Id: Ib5f83cffa87c6dd70df1ca2a83ac398ebc164477