Fix bind_init when setting __init__ method. Add subdocument attribute to
document metadata.