Fixed problem with update_instance, PEP8 fixes and Python 3 compatibility, also fixed repr_attrs for cases where repr is used before __init__ was called