discovery: Add a NewStringFromApp function.

The produced string will be reproducible: apps with same name and identical
labels will produce the same string.
The first three labels, if available, will be (in order): version, os, arch and
the other labels will be ordered by name.
Revert "spec: default digest format is sha512"

This reverts commit b7743540b9a670870281ae5cc6cabaaf5c822b31.

Conflicts:
	SPEC.md
	examples/image.json