restructures js and removes extra empty files