My first stab at a "Test Addon" to aid development shows a bit with the various variables and their definitions (global, local, function local, etc..)
http://www.esoui.com/downloads/info2...AddonTest.html
Might give you a better idea of how it works if you look at the code while using it in game.