Merge pull request #30 from MarcCote/test_smart_worker

Added unit tests for smart_worker.py
Add open_and_lock context manager for file
Removed unused import, made clearer some imports.