Add AMD support

Add JS AMD support to prevent using of global angular & moment. Without
the fix moment logs a warning.