Small log update -- the functions now support a log_level argument. Also prepared context modules for sockets