Finish removing globalstate.

No idea why it passed my local tests before, but I hope this time it will
also pass the Travis tests!