Fix non-runnable tests, and a small glitch in scale calculation
Implement before/after transition callbacks

We need them to specify the scale/orgin values