QC Viewer work (refactoring, completing portions)

Refactored the QC viewer
    Moved all hidden_request branches into switch
    Moved code blocks into seperate methods in some cases
    Re-ordered all the code to follow execution path more closely
    Some calls for storing in CACHE moved to SESSION
Refactored much of the javascript
    Blocks of repeated code removed for page name changed
    Generally moved repeated calls for objects into vars
    Widespread use of split()[1] moved to replace('','')
    Corrected problems on boundary cases (first and last pages)
    SpanArray now a global array, so it does not have to keep being recreated
Main Thumbnail Setting
    Setting main thumbnail does not cause a post-back
    Correctly sets new change on NEXT post-back
QC is now saving to database (need to set page and file count and disksize still)