fix main
have extensions reference root via document so as not to fail in AMD environments