Adjusting the refreshLayers function and adding in change events for the paging control.
merging #734
Merge branch 'RobertDenis-paging-update'