Add a hasBeenUp method which handles flapping. Introduced unit tests

run and debug tasks runs test before launching server
Handle network errors (like remove network cable)