Optimize chaining scopes, function calls.
Merge pull request #338 from knalli/feature/q-chaining

Optimize chaining scopes, function calls.