Adding a new KLP_MATRIX data structure because I was tired of passing four arguments everywhere. This is much cleaner and better encapsulated.