fix math.Matrix

- add const to Matrix.dup()
- add function Matrix.totalOfElements()