implemented configuration file validation and added tests for them, closes #11

I have implemented the configuration validation. I guess it's easy enough to maintain and understand it like this. I also wrote tests for it, which can be checked using nosetests.