Added JUnit and cleaned up tk_tunnel

Added JUnit and cleaned up tk_tunnel.