Improve NSUserDefaults support

This addresses @jspahrsummers's feedback from #1018.