add AMD support for browsers, closes #23