Extract statement context into integer flags

@inikulin figures out this optimization.

ref #213
Extract expression context into integer flags

@inikulin figures out this optimization.
ref #213