Pull script name from pkg.main before defaulting to server.js

Check pkg.main for script name before defaulting to server.js