Added daemon and refactored code into multiple files