Add support for local functions in Lua

With this change both `function foo()...` and `local function foo()` will
trigger the addition of an `end`.

(This also should close #49. Thanks for notes there.)