implement calculation of correlation matrix

and corresponding rest api

Change-Id: I9d853c0e01c6b0d42a3f29532b8fe15e2d09d9d4
Reviewed-on: http://review.couchbase.org/31492
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>