Python 3 compile for Bananapi/RasberryPi

Made the library compile on Python 3 and BananaPi, however the Beaglebone Black is not tested or changed for Python 3. Also compiled on Python 2.