Bugfix last regression, added tests, initial implementation of SNI.