[MRG] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [x] Tests
* [x] docstrings
I'm working on it. I think it makes sense to merge this one first because it is reviewable ;)