Versioning

Add optimistic locking via a numeric version field.
    
If a client fetches a document with version 1, and then tries to post the same document (with the version 1 as part of the POST data), and another client has modified the document in the meantime, the request will fail.

**Note**: This branches from the `use_sinatra_activerecord_tasks` branch. :crying_cat_face: