Generate certs

this PR contains #463

please only review the last commit.
You're going to push up a 0.2 release with the race fix, right?