added packet_map and debug_log; misc changes to allow dynamic adding of circuits