add --daemon-mode option

Closes #39 and #27