Add support for server_name extension.
Refactor out common code for extensions into a common struct.