Avoid hardcoding escript paths and add ESCRIPT_MAIN_MODULE

This PR allows you to specify which module the `main/1` function is defined in and fixes some hardcoded paths in the escript plug-in.