Refactored slider related functionality to its own js file.