Refactor and fix some errors

* Remove nnz, no need of this as we use `std::vector`
* Fix a bug in `is_canonical()` caused because of using `row` instead of
  `p.size()`
* Stop passing parameters to `is_canonical()`
* Make `from_coo()` method static, so we can avoid the redefinition
  See here: http://stackoverflow.com/a/6867017/1895353