recursive context tracing + some basic tests