Abstract out get/set/storageAvailable functions

Will allow us to override the localStorage use with alternate client
side tools (like indexedDB).
Bug Fix: Logic backwards on storageAvailable

turned it the right way around.
Make cacheImages asynchronous

only localStorage works synchronously so we need to adapt it to work
async to allow other client/browser storage methods to work.
Improved - uses a callback on storage ready

This allows us to correctly wait for the database driven storage to
instantiate before processing the page (in testing this was around
130-170ms). Without the delay it would fail to process the media. Local
storage still skips the delay.
IndexedDB now working

WooHoo it is now working with IndexedDB