North Korea recently agreed to halt its nuclear weapon program and allow monitors. But how did such a poor nation become a nuclear power in the first place?