nested twains! with tests! also encode/decode, and stubs for those tests.