Run coverage programmatically

Now works on Windows too.