Refactored daemon, added/tested client