Cleaner port checking logic in dev_server.js