Bug 10240: Offline circulation using HTML5 and IndexedDB

This patch adds an HTML5-based offline mode to Koha's existing
circulation module, allowing librarians to check out items using a
basically familiar interface. The feature will be implemented using
the Application Cache and IndexedDB features of the HTML5 specification,
both of which are fully supported on Firefox 10+ and Chrome 23+, with
limited support going back to Firefox 4 and Chrome 11. The basic
workflow enabled by this patch is as follows:

Part 1: While connected to the Internet
1. Enable offline functionality by turning on the
   "AllowOfflineCirculation" system preference.
2. Sync the offline circulation database on the computer that will be
   used for offline circulation by following the "Offline circulation
   interface" link on the Circulation home page, choosing "Synchronize (must be online)",
   and clicking the "Download records" button. This process may take a while.
3. Bookmark /cgi-bin/koha/circ/offline.pl (the page you are currently
   on) for easy access when offline.

Part 2: While disconnected from the Internet
4. Navigate to /cgi-bin/koha/circ/offline.pl using the bookmark you
   created while online.
5. Start checking books in by scanning the barcode of an item that has
   been returned into the box in the "Check in" tab.
6. Scan the barcodes of any additional items that have been returned.
7. Start checking out books to a patron by scanning the patron's barcode
   in the box in the "Check out" tab.
8. Set a due date (the "Remember for session" box will be checked by
   default, since circulation rules are not computed during offline
   transactions and therefore a due date must be specified by the
   librarian).
9. Scan an item barcode (if you did not set a due date, it will prompt
   you) to check the item out to the patron.
10. If a patron has a fine you can see the total amount (current to when
    the offline module was synced), and record a payment. Unlike when in
    online mode, there will be no breakdown of what item(s) fines are
    for, and you will only be able to record the payment amount and not
    associate it with a particular item.

Part 3: While connected to the Internet
11. Click the "Synchronize" link and choose "Upload transactions" to
    upload the transactions recorded during the offline circulation
    session.
12. Navigate to /cgi-bin/koha/offline_circ/list.pl (there will be a
    link from the Offline circulation page) and review the
    transactions, as described in the documentation for the Firefox
    Offline circulation plugin:
    http://wiki.koha-community.org/wiki/Offline_circulation_firefox_plugin
Bug 10240 QA follow-up

Address the following issues:
    1/ Address minor qa issues with the templates:
     FAIL    koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline-mf.tt
      FAIL      forbidden patterns
                forbidden pattern: intranet-tmpl should certainly
                replaced with [% interface %] (line 24)
                [etc.]
     OK      tt_valid
     OK      valid_template

    FAIL    koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
     FAIL      forbidden patterns
               forbidden pattern: intranet-tmpl should certainly
               replaced with [% interface %] (line 509)
               [etc.]
    FAIL      tt_valid
        lines 5, 5
    3/ download.pl could return data.finished = 1 if number of returned
       data < 5000 (avoid 1 ajax call)
    2/ Run perltidy on new scripts
    4/ Replace qq{} around sql queries with q{}