refactor implementation as c++, add custom indexed deflate compression format