added joint and index avl trees, better io chunks

Added index-based and index-key-based AVL trees. Implemented length processor
for chunks. Added string replacement function.