Replace the lines first; if you make a mess it will not mess-up the new stuff.
Before removing the old lines fill the reservoir to max, place some plastic wrapping over the top before replacing the cap (sealing the reservoir)
Remove the old line and install the new one; one side at a time.
Remove the plastic wrapping from under the reservoir cap.
Place some clear tubing over the bleeder; loosen the bleeder; have a helper slowly depress the brake paddle and hold at the bottom; close the bleeder. Repeat until no bubbles show. Do not let the reservoir go dry! Do the other site. Have a beer
Sealing off the reservoir and breaking the lines loose causes the ebtcm solenoid pack to draw air. Bleeding the solenoid pack is beyond this thread.