Fix transpilation order for AMD

Some AMD implementations like requirejs complain about the module not being found if it's not defined before usage.