Made backend assign correct name to declared globals

Also changed the analyses to add a new analysis, which gathers all the declared globals in a function. This was needed since the code would now have been used in three different analyses.