Mod: add support for Python2.7

This code is tested under Python2.7

Things learned:
1. The first argument to `struct.pack` needs to be a byte sequence in
   Python2.7. So if you imported `unicode_literals` from future,
   remember to use a bytes literal here (`bytes` function works in
   Python2 but you'll need to specify encoding in Python3, bytes literal
   saves alot of typing)
2. `struck.pack` returns `str` in Python2 and `bytes` in Python3. The best
   way to test its return is using a byte literal here (same reason
   stated above.)