Add support for directional matrices

Allow square matrices (class matrix) in addition to lower-triangular
matrices (class dist)