made a few small improvements to Realm usage

Nice work!

I made a few simplifications around Realm (no need to copy things into memory :smile:) and Swift (`self.` is implicit unless in a closure).