Updated the function purity checker to work on functions.
Broken. Started updating the function purity checker to check globals.