Add tracing functionality.

Adds a functions to trace and untrace a var from the buffer.