Merge pull request #8088 from KevinGrandon/shared_lazy_loader

Bug 841251 - Implement a simple shared lazy loader.

Official r=viven, thanks to mozsquib, rwldrn, asuth, daleharvey for feedback.(cherry picked from commit ab1d2c275643769a1854c49bfe5a3db2aa972542)

Conflicts:
	apps/gallery/js/gallery.js
(cherry picked from commit 9d95495833bfefa5e536e16b087f4a92b5cc17ee)