Tidy up this testcase and add test for tailcall optimization