Cleaned up entity loading and creation code.

As per dickolsson's comment on https://github.com/dickolsson/drupal-relaxed/pull/5#discussion_r18429669