Move segment assignment serverside

To get away from reloading the page with JS and all of the ugliness
that that entails, segment assignment is now done serverside and the
segment cookie now contains the name of the segment instead of an int
between 1 and 100.