Function redefinition fix

This PR fixes bugs when a function is redefined in a codeblock 
1. Redefine a function by changing its name
2. Redefine a function by changing its arguments
All statements using these modified functions must be re-executed.

http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5179

@lukechurch  @ke-yu 
@monikaprabhu pls see the related LiveRunner test. 

My the other point is, we put a piece of code in a function is not to make the original function shorter, but think this piece of code could be reusable. If it isn't, then this function is dead function and doesn't make sense to exist. Well, just my 2 cents.