merged initial exploratory code for encoder state persistence
work in progress on encoder state persistence