added support for de/encoding binaries/terms