Bleach is by far the best mold killer. It works a lot better than hydrogen peroxide and it's a lot less expensive. Repeated application to wood so that it soaks in
will kill hyphae that are burrowing into the structure of the wood.
And after bleach has done its work and decomposed, it doesn't leave a toxic residue. Bleach is sodium hypochlorite, NaClO, and its killing power comes from the powerful oxidizing effect of the ClO- ion. Once it is done oxidizing something and the oxygen is gone, all you are left with is NaCl -- regular salt.
The trick with using it is to protect yourself so that none of that powerful oxidizing effect takes place on your skin, eyes, nasal passages, etc. Most commercially sold bleach preparations are around 5%, which is more concentrated than necessary to kill fungi. If you dilute it up, 1 part in 10 parts of
water, it will still be efficacious and much easier to work with. Most of the bad reputation bleach has as a chemical to be avoided is because people use it carelessly at concentrations larger than are necessary.
If you give your studs and beams a thorough bleach treatment and then, as Michael says, keep it properly dry, your problems should be solved.