[bug 889549] Added nunjucks for clientside rendering (dev mode only for now), some restructuring of stuff in mediaGallery