As long as the drive/hydrostatic pumps are OK, you should be fine. I just replace the hydraulic pump (the one that controls the arms/bucket) on an 863 about a month ago. The customer bought the parts which included a new pump and an adapter fitting (because the new one was ported differently), and I think the parts total was somewhere areound $700.
As far as the system being contaminated, what happened to the old pump? Typlcally the pump body is made of aluminium, and they will wear internally until they don't work anymore. That said, unless it just flat out disentigrated, there's really nothing in the system to clean out, as any of the material that came from it would have been filtered out of it by the return oil filter. Even if it did disentigrate, there's not alot you can really do to 'clean' it out without taking every part of the system apart, and running something through each and every line to inure no particles of pump remain. That said since the pump does nothing but work the cylinders on the loader arms having it 110% 'squeaky clean' isn't as important as it would be if it ran a hydraulic motor, etc. (like the hydrostatic system). In other words the cylinders are usually going to do nothing but suck in any material and the force it right back out when they reverse direction, with no real harm caused.
As far as clean out goes, internally the valve is nothing but openings cast into the valve body and grooves in the spool to connect those openings to operate the machin/cylinders. Basically there really isn't much inside the valve body to flush out because, in most cases, any material in the oil stream would have gone on through the system, and been filtered out when the machine was running. There might be a little bit of material built up inside of the base of the cylinders, but the only way to really get all of that out would be to dissasemble the cylinders. Usually though it's going to do nothing but lay there until the force of the oil moving around it carries it back to the return oil filter, removing it from the system.
Ultimately, like I said, unless the old pump just completely disentigrated, there's really not alot you need to do to get the machine back in operation. Basically reassemble it with the new pump, run it for a day or so to flush out the system, and then change the filter, and you should be good to go.
Over the years I've changed out quite a few pumps that 'went bad' on everything from dozers to excavators. Unlike the dealerships who want to charge both arms and legs, and other parts of the anatomy, to do a complete system cleanout/flush, I have never had a customer put me in a position time, or money, wise to go to that extreem. To that end I've always done the best I could to insure the tank, etc was clean, and that the return filters were new/clean. I never worried about the valving or anything like that as going to that extrem would have, in most cases taken weeks to do. I have never had a problem out of any of the machines I have repaired caused by material from the damaged pump.
Good luck and if you run into any problems feel free to post again. Wayne