Improved flake8 and test management commands to correctly detect path and ignore appropriate directories