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.
Just changed this static method so it is shorter and fails on unexpected arguments.