Moved Lua API registering into a separate function.

This will allow us to use Lua as lite-config files as well, should we want to.