Separate doc on defining magics

CC @fperez - as discussed at dinner yesterday, this is a clearer place for this information. I've left a link to it from the place where it was before.