Fix selection of first graphnode to execute in a function

1. Add a property to the graphnopde to determine if its immediate scope
is a function
2. Nested language testcase

@ke-yu
@lukechurch