AMD compatible version, to use with RequireJS