Added support for global variables and doc'ed it.