Added support for tls connections (barely). Also tried to generalize the [GS]etOption methods to take in and return an interface instead of the type.