Formatted code, added regex based filename conversion to prevent crashes with mods with sub modules.