Set AMD global before module definition

Make sure non AMD compatible modules work well with moment in require.js. This is based on https://github.com/moment/moment/issues/1574