config file parsing
Loads config and checks if it exists and is valid.