make module compatible with amd and browser