Implement moving to the function entry, and correct the implementation of
moving until a function is finished so that it works for non-active functions.
This handles part of #3.