Watchservice + code reorganization

Watchservice working but needs to be linked to main code.