feat($animate): provide support for a close callback

Closes #5685
Closes #5053
Closes #4993