Support for automatically adding realm
Fixed up tests..
Merge branch 'refs/heads/addRealmToSamAccount'