Slightly changed config system.
* global variables -> named constants
* added config check