Implement record deletion.

First checks if the record is already loaded in the store to prevent additional requests to the server.

Then checks that the record isn't dirty in case it is in the process of being deleted.