Add a bug fix plus tests for calling functions in Jinja via dot-lookup notation

Re-opening #13988 against 2014.7.