Initial implementation for apply logic, replaces function body with a
semicolon in source location and copies the full function definition into target
location.
Will handle qualification of return type and function name in following patches
to keep the changes small.
this function seems trivial, I'd inline them into call sides for both define inline and outline.