Refactor out sysconfig handling

OK, renaming sounds reasonable. What about `ensure_file_exists_on_target`?