Implement exec() and friends

WIP