Added dirty tracking for attributes, using ActiveModel::Dirty

Change-Id: Ibb9975b06755d4accc3201837144cd90797c0015
Reviewed-on: http://review.couchbase.org/33857
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>