Extract repository layer

Rather than directly accessing the ActiveRecord `Entry` objects in the
service layer, the code now uses a repository for persisting entries. In
addition, rather than pass back ActiveRecord objects, the repository
returns entities, which are plain Ruby objects. Granted the "entity"
suffix is not ideal, but given ActiveRecord's wiring, it seems a decent
compromise.

With the current setup, the `Entity` object is used only for reading and
writing from the database, thus following the single reponsibility
principle.