Rewrite launcher into single script suiteable for auto restarting