Add commit persistance code and tests