Plot of the Mean Deph

The mean depth now is plotted correctly.
I wanted to do more stuff on this commit, but since
it required that a few things on profile.c got moved
to profile.h, commited to not have a huge blob for review.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>