fix requirejs errors fixes #31 fixes #8 fixes #1