support main thread gates
add lots of instrumentation

also svg output