This is a port/fixup of stagger to support Python 3.3/3.4