CVector and CMatrix classes improvements and refactoring