[MRG] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [x] Tests
* [x] docstrings
I replicated the previous tests. I didn't want to test less than before.