Add a function for recursive directory removal and use that instead of xsystem.