Break out Anchor.onChange helper functions

This should be faster since we don't have to re-initialize the helper
functions each time Anchor.onChange is fired.