Implement Bertlv and add test for it