Fix Applyupdate dirty node accumulation

1. By default, set the entry point of an execution session in the
codegen. If there are force exec ASTs and no deltas, set entrypoint to
be the first forceexec AST
2. Code cleanup
3. Add testcase
Merge pull request #2729 from junmendoza/master

Fix Applyupdate dirty node accumulation
Merge remote-tracking branch 'origin/master' into SolarRadiation