For the following compounds, the correct statement(s) with respect to nucleophilic substitution reaction is(are)

(A) I and III follow SN1 mechanism
(B) I and II follow SN2 mechanism
(C) Compound IV undergoes inversion of configuration
(D) The order of reactivity for I, III and IV is : IV > I > III