add unit tests + BHASH encode/decode functionality