Federal cabinet agreed on the royal commission's terms of reference today, with former Northern Territory chief justice Brian Martin named to head the inquiry.