improvements in documentation (doxygen), and fixed bug in maximum common divisor (mcd) function.

TODO: refactor, improve documentation