Implements gram schmidt orthonormalization of a set of basis vectors