Manipulate binary structures as classes in python