serialize context instead of trying to recreate it
fix restoring options after serialization
fix loading of stuff in kast and krun
Merge pull request #749 from dwightguth/serialize-context2

serialize context instead of trying to recreate it