Fix NullPointerExceptions for 1.7.9
Refactored state persistence, other misc changes
Increment version number.