Add cdb tests for encode/decode composite/non-composite types

developed while debugging bug 2886