Implementation of cachematrix.
Implementation of cachevector to serve as reference.