added test cases and header files for matrix_weight.c
re-organized directory strucure