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.
Why do you need to iterate? You can do it with 2 if statements:
```python
if 'strategy' in kwargs:
  copts.checkout_strategy = kwargs['strategy']

if 'directory' in kwargs:
  target_dir = ffi.new('char[]', to_str(kwargs['directory']))
  refs.append(target_dir)
  copts.target_directory = target_dir
```