Added config for nose/flake8/coverage and tests for utils.py

- fixed a bug in new_closure
- pep8 fixes
- updated pip dependencies