Simple trace encoder and decoder.