Begin Refactoring Zoomify Javascript