add support for function with name

1. function.name will be saved

2. simplify `makeFunction`

3. bind f.scope to f