Fix an issue where abandoned states weren't destroyed correctly

Abandoned states were being destroyed from within a wrong closure,
and state + lastParams in the 'right' closure weren't nulled, which
causes issues. That's fixed by nulling them in beforeModel if needed.
However this really needs a bit of refactoring to not rely on closures
and instead store the state on the handler objectst.