test encoding and decoding
add decoding, backwards compatible
document encoding and decoding