Add saveing instance state code. Update library.