Simplify plot and windows module linking

Use the dynamic linking to refer to plot global variables to bind the
windows module.

Remove the need of storing a C struct with pointers in Lua's registry.