Implement NSUserDefaults

Get rid of this code if it's no longer relevant.