added support for CASCADE as per CouchDB/ORM etc
ensure the collection is initialized before unwrapping
ported some tests for cascading from CouchDB ODM
cosmetic tweaks