UIPaging: Support dynamic sections & infinite loop

For my app I need to add new sections to a $.UIPaging element dynamically based on search results returned from a server. Unfortunately the current implementation doesn't support dynamically added sections and stays with it's initial value when created. This code allows for sections to be added and removed at run time.

In addition I also wanted the paging to go round in an infinite loop (i.e. when you get to the end paging once more to the right moves back to the beginning). This is partly a unique design decision on my part, but may be useful in general. In short I found it pain to navigate back through all the sections once I got to the end just to get to the first one.