switched to using local variables in update func's

Now using local variables instead of global variables where possible in
the update function and the update functions for communicating with
keyspaces and synchronizing. Hopefully this'll improve performance
somewhat