new unit tests
log and calls to functions
port to 5.2 structure
wrap_tcp visibility back to local
add debug messages