Fixed #29. Made it work with nullable foreign keys. 

I'm actually opposed to this change. I'd rather duck-type (does it act enough like a dict to be usable as such?) here, unless there's a good reason not to.