Updated library, added persistent socket support and TLS socket support