[feature] Fix Javascript errors introduced by webpack

This changes no functionality, but fixes errors introduced by the order javascript files were included on the user profile and node registration pages.
I think it may have to do with the mako `def` within an `if` block. I was able to fix it by moving the `def` out of the conditional. See 5637048792ffece5dd4a1ffe85bc72e07a171d7c