Make many changes mainly to make some wnet functionality in manager.py and make it testable