Background tasks

Added background tasks, to allow a module to perform actions even if
there are no clients connected