[WIP] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [ ] Tests
* [x] docstrings
Do we actually need this argument, or could we do simply with 'allowed_sparse'?