fixup lua <-> boost function binding system

The solution in place was working but it was flawed in that unlike
with normal lua callbacks, the callbacks would find the userdata
with a pointer to themselves as the first item on the stack. This
breaks the normal lua stack discipline for callback functions.

This commit makes it work normally, removing the stack entry for
the function before it is called, and also making a local copy
of the function pointer in case the lua garbage collector should
deallocate and destroy it when it is removed from the stack.
fixup ilua _pretty_print function

had some global vs local problems after making this a module loaded
with require rather than a dofile script
Merge branch 'master' of https://github.com/wesnoth/wesnoth
add a "__tostring" method for boost functions

It makes it easier to realize that they are functions when in the
console.
clean up some comments, improve type-safety in lua boost function
move lua boost::function wrapper to scripting/lua_cpp_function.?pp
fix a warning: placement new syntax does not require var assignment

Coverity complained about this and I added compiler directives to
suppress the unused var when I first wrote this, but in fact the
variable is unnecessary and this is the correct way.
complain more loudly about memory leaks
remove resources.hpp links from playmp, playsingle controllers
Update Xcode project file
make 'extract_preload_scripts' a class member function
Merge branch 'master' of https://github.com/wesnoth/wesnoth
fix a camelcase identifier LuaKernel -> game_lua_kernel
add support for mass registration of C++ functions with lua
move lua fcn 'wesnoth.tovconfig' to lua kernel base / lua common

there was no reason for it to only be in the game kernel, most
other vconfig functions were already in lua common.
rename set_cpp_funcs to 'set_functions' in lua_cpp namespace
add support for lua cpp function closures

This is important because the userdata function objects, although
they have call operators, don't seem to work quite right when used
in metatables.
refactor game_lua_kernel not to use resources:: for gamestate

This commit changes the majority of the wesnoth callback functions
for the game lua kernel to be private methods of the game lua
kernel. The game lua kernel is given direct access, via it's ctor,
to references of many of the things provided by resources. The
call back functions are modified to access these private reference
variables instead of resources, and they are added to the
scripting environment using the lua cpp function mechanism.

This greatly improves encapsulation and will eventually lead to
eliminating the resources pointers from the game lua kernel
entirely.
convert some null pointer dereferences into assertion failures
fixup replay reset: reconstruct the lua kernel