Added ConfigManager to preserve some values (project_dir etc). Fixes #221