Pull request for issues #1841 and #1840

For #1840, I did a nasty thing to get around the setuptools sandbox. Your comments?
For #1841, please review each commit separately so you'll understand which files I moved, and which I changed - as I moved the files from bin/ to lib/ansible/scripts and creates other ones in bin/

Just throw me your comments and I'll adjust the code...

Thanks,
Guy