Refactoring code to allow for starting/pausing/resuming of slideshows from outside plugin.