Implemented method call chaining
Handle nested calls and function oneliners when chaining
Merge pull request #3263 from xixixao/issue1495

Implement #1495,  Method call chaining