src: share common code paths for SEA and embedder script
Since SEA is very similar in principle to embedding functionality, it makes sense to share code paths where possible. This commit does so and addresses a TODO
while doing so.
It also adds a utility to directly run CJS code to the embedder startup callback, which comes in handy for this purpose.
Finally, this commit is breaking because it aligns the behavior of require()
ing internal modules; previously, embedders could use the require
function that they received to do so. (If this is not considered breaking because accessing internals is not covered by the API, then this would need ABI compatibility patches for becoming fully non-breaking.)