Fix wheel support and pip version compatability

Fix wheel support and compatability for older pip versions by detecting suppport
when running the pip command inside a virtualenv.
Fix quoting of exec commands to use single quotes
Fix syntax error in conditional statement
Fix handling of wheel support for initial pip
Fix simple typo
Fix bash logic false positives
Further fixes for pip 1.5 and wheel handling
Fix testing for existing virtual environment
Fix grep for detecting if virtenv needs rebuild