Don't leave our macros defined when they're for internal use.
add % operator.
Add test of % operator
Add % operator to detail/operator_id, fixes test.
Work around a VC11 optimizer bug.

It looks like VC11's optimizer does something wrong with the dtor of
the scoped std::string. So use lua_pushfstring() instead. It's faster
and more readable anyway.
Unset metatable when destroying C++-objects.

When using Lua 5.2's __gc or luabinds __finalize metamethods, it is possible to
access userdata after its __gc metamethod has been called. Unsetting its
metatable turns undefined behavior in an ordinary Lua error (LUA_ERRGCMM).

Assuming CppClass is a C++-class exported by luabind, the following code
triggers undefined behavior (needs Lua 5.2 for __gc support for tables):
    t = { }
    setmetatable(t, {__gc = function(t)
        t.cppClass:method() end})
    t.cppClass = CppClass()

Since "the finalizers for objects are called in the reverse order that they
were marked for collection" [1], this will try to call the __index metamethod
of t.cppClass after the object_rep for it (and itself) has been destroyed. The
call to t.cppClass:method() results in undefined behavior (in the particular
case where I noticed the bug (on VS11, Win 7 x64) it was a pure virtual
function call to luabind::detail::instance_holder::get()). With this patch
applied, Lua will instead issue a runtime error because of indexing an userdata
without __index metamethod.

See also
    [1]: http://www.lua.org/manual/5.2/manual.html#2.5.1
    http://lua.2524044.n2.nabble.com/userdata-access-after-gc-td7643253.html
Modified from original Oberon00 commit by removing a "pop self" command in wrapper_base.

Fix weak_ref bug.

See http://lua.2524044.n2.nabble.com/weak-ref-issue-patch-td7581558.html for an
explanation and a patch for an older luabind version, which I have just adapted.

Quote:
> This prevents the same id from being used by two weak_refs at the same time,
> which previously could result in the Lua portion of a wrap_base derived class
> from being lost or aliased by another object.

Conflicts:
	src/wrapper_base.cpp
Add std_shared_ptr_converter.hpp.

Include this file if you want to use std::shared_ptr with luabind. Although
it's quite hacky, it seems to work with at least VC11 and the g++ included in
Ubuntu 12.10.