Refs #29. Made it work with nullable foreign keys.
Fixed #29. Fixed all tests that got broken in last changeset.
Refs #29. Reverted line that determines if object is dictionary.
Merge pull request #30 from karmux/master

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