Fix inferStdLib and its helper functions to work with new function call tree structure.
Fix inferStdLib and its helper functions to work with new function call
tree structure.

IanFinlayson/tetra,IanFinlayson/tetra,IanFinlayson/tetra,IanFinlayson/tetra,IanFinlayson/tetra,IanFinlayson/tetra