XCONTRIB-237: Add support for autocompleting nested method calls
* Complete rewrite to be generic and to support any nesting level