add matrix operations

added row switching and multiplication, refactored matrix class
add new matrix extensions