Added buffer redirection code (terminalBuffer.lua)

Signed-off-by: Martin Evans <martindevans@gmail.com>