Fixed issue with logging and added capability to execute in background.

- fixed issue with logging
- logging is now done in a proper way :)
- capability to execute in background

Please notice that new configuration settings has been added.