Switch to using print as a function

Change-Id: I5c81a2c264a41eb6252f5f5a47ed2f77e0e7c50e
Remove unused imports

Change-Id: I929f4f6d980ad79cadfd404652a65a3a3faebcbf
Directly mock just the methods expected, not a whole file()

file() doesn't exist in python 3, and as we don't really need it,
switching away from using it is simplest.

Change-Id: I5475306e912a74cbba0fcf0e92cd85759c37c088
Import and module naming adjustments for python 3

Change-Id: I13eb8519022eeea920489c118543f463ee244738
Compensate for Exception.message not being in python 3

At least not on the SystemExit exception.

Change-Id: I6c026b140f89c28b2defe8ef037bb90f2975adf9
Claim support for Python 3.x now that that works.

Change-Id: Ie7c58356d1e8a39f55c08e79803dc416b0411ce7
Be more specific about the exceptions being caught

In the case of main.py, we get different exceptions in differnt
places under nosetests hence the double listing.

Change-Id: I54c89fa953ce4728dcae7a9ea72b46b54e7ebe0d
Merge test fix from  'PeterJCLaw/master'