generalized trace_quad_form for autodiff types and added tests
fixed includes for quad_form
generalized trace_gen_quad_form for autodiff types and added tests