Move checkout to CFFI and add a target directory option

Having it at the python level should also make it easer to extend with more options in the future as needed.
It's a leftover from working with less abstract constructions; but it's a guess as to how many parameters will actually be passed versus how many we will be looking at. I'm not a fan of looking up the same key twice, but it can be reduced.