mdot: allow 1d as first and last arguments.

This explicitly concerts the 1d arrays to 2d arrays to keep the logic of the
internal functions simple.  The result is a 2d array whereas without the
conversation the result would have been 1d.

Alternatively, we could not convert the input arrays but change the internal
functions.