Config refactoring

WIP, do not merge yet

Here i'll implement changes proposed in #8, starting now with some more robust validations.

More coming soon