Add on_destroy event and improve DOM hiding

Added on_destory event, which allows callers to execute custom code when
slide show is ended. Fixed bug where initially hidden DOM elements were
incorrectly made visible at conclusion of slide show.