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