Use ActiveRecord

This makes the code in the examples simpler (and closer to real life).
The scaffolding around it is more complex, but that doesn't matter for
this post.