use jsonsha struct

Avoid the duplication of multiple identical anonymous structs just for
encoding/decoding the sha256.
standardize hkdist paths, struct usage