add the possibility to use a daemon

Also use logging instead of print :)