Added naming capabilities to external function and automatic naming...
Also added a unit test for that...