Compatibility changes to bring in line with psiphon-tunnel-core
Code rewrite

Rewritten for code reusability and to run tunneled and untunneled tasks
in separate go routines.