Initial commit (unfinished)

Currently evertyhing is working except for defrag method. Defrag method has bug in which it overwrites the indices with the indices of the final one.