tools: move config.h reading to its own file