Looking at the amount of dirt in the two holes, just replacing the tank could cause more damage. You need to take that cylinder off, and clean or rebuild it. Also clean out the two tubes to the switch as minimum, before bleeding the whole system.
Look at this for a tank take off. only $50 on epay. Brake Master Cylinder ; Humvee Hummer ECV ; 2530015685097 6500446 02040C2315