Extending removeFromRealm() to be able to remove last object

As reported in #595 `removeFromRealm()` does not work when removing the last object. This PR fixes the bug, and adds a number of unit tests.

@emanuelez @bmunkholm @cmelchior 
If you need a comment after a method call, it's because the method name could be better :-)