Update go2function.py

Speed improvements and better handling of settings.