[abi] Improve JSON encoding of selectors + layout key (#207)

* Export selector as hex string

To have an unambiguous exported representation.
The previously used `u32` can be interpreted
differently depending on the endianness of the
target system.

* Improve JSON encoding of Key `layout` in Metadata

* Add tests for selector serialization

* Encode selector as [u8; 4]

* Remove unused import

* Satisfy rustfmt check

* Improve messages! macro

* Convert tabs to spaces.
* Replace `DELIMITER` with `@delimiter`.
* Improve comments.

* Improve comment

* Ensure old ABI format stays the same

* Reduce code duplication by introducing selector_to_expr()

* Satisfy rustfmt
10 jobs for master in 1 minute and 33 seconds (queued for 1 second)
Status Job ID Name Coverage
  Check Workspace
failed #253104
linux-docker
cargo-build-nf

00:00:56

failed #253098
linux-docker
cargo-check-af

00:01:33

failed #253099
linux-docker
cargo-check-nf

00:01:09

failed #253101
linux-docker
cargo-clippy-af

00:00:55

failed #253102
linux-docker
cargo-clippy-nf

00:01:30

failed #253100
linux-docker
cargo-fmt

00:00:46

failed #253103
linux-docker
cargo-test-af

00:01:17

 
  Examples
skipped #253107
linux-docker
examples-abi
skipped #253106
linux-docker
examples-test
skipped #253105
linux-docker
examples-wasm
 
Name Stage Failure
failed
cargo-check-af Check Workspace
No job log
failed
cargo-clippy-nf Check Workspace
No job log
failed
cargo-test-af Check Workspace
No job log
failed
cargo-check-nf Check Workspace
No job log
failed
cargo-build-nf Check Workspace
No job log
failed
cargo-clippy-af Check Workspace
No job log
failed
cargo-fmt Check Workspace
No job log