[MRG] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [x] Tests
* [x] docstrings
Sorry I don't understand. That's what is says, right?