Biogen, Idec agree to merge in stock deal