Adding python3 support and shortening setter code.