[build] do not link to liblua

See "Do Not Link Modules to the Lua Core Libraries" on
http://lua-users.org/wiki/BuildingModules

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
init libmosquitto with module loading

Instead of require user to manually call init() we call it on module
loading. We keep the init() function for backwards compatibility.

Also do some whitespace fixes (spaces before tabs etc)

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
support setting callback via metamethod

This allows us to set callbacks with the syntax:

  client.ON_CONNECT = function(...) print(...) end

This also enables support for setting the callback with a string:

  client:set_callback("ON_CONNECT", function(...) print(...) end))

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
use sensible defaults for connect/connect_async

We make the args for connect() and connect_async() optional and use
same defaults as mosquitto_sub:

  host = "localhost"
  port = 1883
  keepalive = 60

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>