Hack around write_toplevel_names
Add local to gitignore so people can't accidentally commit keys
Add tests and test certificate, fix some bugs