ported linrat_expr to new table structure, simplified. coeff_for_var now returns 0 if var not in expression