Remove unused modules, add substring history and archive