Support adding element directly and indirectly to InMemoryDataContext. Previously causes error on commit.
Merge pull request #52 from longility/master

Support adding element directly and indirectly to InMemoryDataContext.