Added become daemon function. Updated lib common init and deinit scenarios