ISPN-3779 

- Code polish and memory usage improvements for InvocationContext implementations
- Get rid of the flags being encoded as bits