Numpy improvement

* diag
* sum
* better type inference
* better slices management
* add tests