Start using typed units in rust-layers

This allows conversion between unit types which are self-documenting and helps prevent the introduction of errors or confusion about unit types.