First working version

doesn't run as systray icon yet.