simplified TLS proxy handling; added timeout option
massive refactoring, added threading
cleanup