Refactored basic directory structure.
Moved to ActiveSupport for Validations and Callbacks.
Cleaned up older code, and removed support for text property types.
encoding was done twice, once while setting attachment
and once while saving the document.
Also the attachment was decoded while retreaving, but this is done by
CouchDB itself automatically, as described in
http://wiki.apache.org/couchdb/HTTP_Document_API#line-463.
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>