Lua state error handler

Implements #418 - the server outputs full Lua stacktrace on an error.