cloudfront module: add backward-compatible support for Python 3.3+

Unit tests passed.

No integration tests to test with, I managed to run some of my current code with the ported version, and it works.