Your right, Don't have the cap off when you push the pistons back into the calipers as fluid returns up into the reservoir and if the cap was off, Brake fluid eats paint. With 4 pistons that part is a little tricky as when you push one in, one pops out. Best to clean em 1st, slap old pads back in (Just for a second) and pry them apart with a wedge until the pistons go back in. I use a old RR tie spike. Wood cut into wedges works good too.
I edited my Org. Post to Add instructions on how to bleed you brakes and change the fluid at the same time.
I always bleed first before putting on the new pads. Reason being all the crap, and rust goes to the lowest point of the braking system and in this case it's always the calipers. When you compress the piston to put the new pads on, the crap and rust in the caliper is forced back into the system and might even make it up to the master cylinder and cause a brake failure in the near future.
My advice is to bleed the brakes first and get rid of the crap and leave the reservoir low then replace the pads. This way when you push the piston back you won't shove crap or excess fluid into the reservoir or master cylinder.
I've also heard a few people suggest not even bothering with bleeding the system when changing pads. It's your bike do as you wish but it's cheap to bleed the system.