Update matrix_chain_mul.pl

The file now acts as a script to transform test.pl to test_out.pl which generates excel code. Added some new functions, controlling script and reordered some functions.
Needs to be documented more comprehensively.