Major code refactoring

Using Python 3  instead of 2 now. Also, not using the google
supplied libraries; just working from the standard library, both
for my own learning and to make it more portable.