Move attachment code into couch_att

This is an attempt to isolate the attachment record and
some related code. This will allow seamless upgrades
over time. Part of a [dbcore pull request](https://github.com/cloudant/dbcore/pull/181).