Lazily generated SharedPref editor context field

This code changes eager field generation to lazy, so the context field in SharedPref Editor classes is only generated if needed. Related #1030.