Carbon and nitrogen in earth and planetary interiors