finish server part of SSL Server Name Identification

as requested by @rmculpepper, the continuation of PR #640. i rebased it up to the latest commits in master, as of a few minutes ago.

for any new readers, there's rough test code available in https://gist.github.com/jkominek/605a26e72ab0b995a6cd which uses the client and server portion together to test the functionality.