[WIP] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [ ] Tests
* [x] docstrings
It is at "convert_sparse_to", right?