Remove main.js requirement for themes

This is for #8626.
Does `metadata` exist in that scope? I just read the code again, I don't see any place `metadata` has been introduced in that scope unless it is coming in through the `callback` parameter.