extract_term_to_matrix function

Extracts a term with one column per fixed or random-level into a matrix