Refactoring work on tasks.py and begining support for windows