added matrix-vector multiplication, matrix flattening, tests; made it buildable