Basic encode/decode functionality for BWT and Keyword-based encode/decode