Refactor common code out of prepareForInterpretation/Compilation

* Since we can now safely attempt to run passes multiple times
  (and they won't run if they have previously run and haven't been
  invalidated), always attempt to run interp passes before
  JIT passes. For the normal interp+JIT case, this works properly.
  For the threshold=0 case, this will also work properly since the
  scope will be brought to the same state as if the interp had run.