adds onLaunch, and the possibility to launch a server

(Note only tested in osx)