Changed and fixed cov2corr

I changed and fixed the `cov2corr` function, which gave wrong results. I added a test and simple docs. 
I will wait for the Travis builds to pass and then merge it...