Fixed Doxygen commenting

Refs #4443
Implemented the method

Refs #4443
Implemented Unit tests

Refs #4443
Added some code so it is possible to test from MantidPlot

Refs #4443
Moved debugging code to more appropriate place

Refs #4443
refs #4443. Solve merge conflict.