testsuite: lua-TestMore: fix require_ok

require_ok() from Lua-TestMore was returning the wrong value
from require(), so couldn't acutally be used for modules that
don't modify global environment.
testsuite: fixes for flux sharness extensions

There is no reason to blow away LUA_PATH and LUA_CPATH before
running Flux tests, this in fact inhibits some debugging activities.

Also, only change directory to SHARNESS_TEST_DIRECTORY if that
variable is in fact set to something.
lua: fix intractable memory management for zmsgs

zmsg-lua module tried to be clever about saving the original
zmsg by pretending we freed the message but actually saving
the original in a zmsg_info object.

This turned out to be too difficult to get right, and "something"
at a higher level seemed to be freeing or modifying the zmsgs
such that the subsequent zmsg_destroy() invoked by Lua garbage
collection was getting memory errors. (We got away with these
most of the time, but only by luck)

This patch chickens out and saves a copy of each zmsg in the
zmsg_info structure.
lua: Add flux_reactor_stop

Add missing reactor_stop() Lua method for flux handle objects.
lua: Add method for flux_recv_event

Add missing method for flux_recv_event on Lua flux objects.
lua: kvswatch callbacks now have return code

Get return code from kvswatch callbacks and pass back to reactor.
Return code of -1 will abort reactor.
lua: cleanup stack when creating new reftable entry

In l_flux_ref_create() pop the top member from the stack before creating
a new reftable. This leaves the stack in the same state after the
"if isnil" block as it would have been if the reftable was found in the
first place, and thus restricts unecessary stack growth (and probably a
couple bugs.)
lua: add flux:timer method for reactor timeouts

Add missing support for flux reactor "tmouthanders", accessed by
flux:timer{} from Lua code.
lua: add lalarm module

The lalarm module can be useful in testing. Thus, include it
as a 'noinst' module with the rest of the Flux bindings.
testsuite: Add driver for flux lua tests

Add 'fluxometer' module for use in bootstrapping lua tests under ./t.
The fluxometer module provides a sharness-like environment where
test scripts can reinvoke themselves under a flux session.
build: add fluxometer.lua to AC_CONFIG_FILES

The fluxometer module is rewritten by ./configure with
abs_srcdir and abs_builddir. So add it to AC_CONFIG_FILES.
testsuite: Add lua tests

Add a suite of flux lua api tests using fluxometer under ./t/lua/
testsuite: Run lua tests as part of testsuite
testsuite: Add a bit of text about Lua tests to README

Document Lua tests and use of fluxometer module in the testsuite
README.md.
lua: Add luaL_setfuncs if needed to lua utils code

For 5.1/5.2 compatibility, add a luaL_setfuncs implementation that
will work on 5.0/5.1.
lua: replace luaL_register with luaL_setfuncs

For Lua 5.2 compatibility, use luaL_setfuncs instead of luaL_register.
lua: avoid use of LUA_GLOBALSINDEX

LUA_GLOBALSINDEX was removed from lua 5.2, use the globals
access functions instead like lua_getglobal, lua_setglobal.
build: Allow build with Lua 5.2

Allow Lua versions up to Lua 5.2 during configure.
wreck: fix bug in use of posix module in lua plugin

In 01-env.lua wreck/lua plugin, the posix module was being
loaded but assigned to the variable `p' instead of `posix'.
The code itself referenced the `posix' table, but this only
worked becuase Lua 5.1 effect of instantiating a global
'posix' table when loading the lua-posix module.

In 5.2, modules can no longer instantiate global tables, so
the 01-env.lua plugin was broken.

This patch simply assigns the lua-posix module table correctly
to the 'posix' variable. (now a local)
Merge pull request #97 from grondo/lua-5.2

Lua bindings enhancements: timer methods, testsuite, and Lua 5.2 support