Add an isSameDimension method.

This functionality is common enough.
Refactor _checkVectorSpace to use isSameDimension.
Add new isSameVectorSpace method.
Refactor _checkVectorSpace to use isSameVectorSpace.