Add virtualenv support. Python interpreter will be reused from the script directory.
Fix path join.
Remove obsolete code and fix tests. Add more comments.