Length and ScaleFactor with statically-checked units

For mozilla/servo#2226. See code comments for details.