Added complex module code

Made it Lua 5.2.3 compliant