Allow Handlebars to be a global

If Handlebars is included in optimizer, the shim don't work. Always have a fallback to window.