Base-pair opening and closing reactions in the double helix