MRG add log loss (cross-entropy loss) to metrics

Reissue of #1125 with a clearer implementation, more documentation and more tests.