Converted to Python 3.x

This commit is fully operational in python 3. I removed some of the
error handling and all of the printing - these should be done by those
using the library as it is application dependent.