Update ballot page code to support running in static context