Anthony Joshua stopped Charles Martin in the second round to become the new IBF world heavyweight champion.