Add trace() method to MatrixLib.

@lileicc Just add the trace() method.