Added functionIds to function nodes as this simplifies some common traversals.