Added more recursive lookup and checking functionality for namespace and change scope function storage to dict or dicts for overloading