Added `to_matrix` method to Vector and Dyadic in mechanics.

When jumping back and forth from symbolics to numerics when using the mechanics
module it would be nice to be able to output the matrix forms of vectors and
dyadics with respect to different reference frames. I've added two new methods
that provide this functionality. It is particularly useful for returning
inertia tensors in reference frames from dyadics as the tensor form in the more
widely used.
Changed syntax on the doc test so it now passes.
Simplified the code with list comprehensions.
Added notes in documentation about .
Merge pull request #2686 from moorepants/dyadic-2-tensor

Added `to_matrix` method to Vector and Dyadic in mechanics.