Added Python3 support. Now Python 2 or 3 can be used with the same code

The code is runnable with Python3 and Python2 now. Tested with Python 2.7 and Python 3.3.
Please write code in the future for Python 2 and 3, so both are supported
I couldn't figure out why, but in Python 2 it is working with an elif and in Python 3 he whole metadata is missing and I get a 0 byte sized .bin file. With an if it seems to work... Maybe you can have a look at it when you have time.