Properly separate functions and methods when creating Lua types.

They are both registered the same way for now, but this might change
later.