Transferring and compressing sludge and screenings