Added functional tests for encode/decode and encrypt/decrypt