Issue 133 merge

issue number #242 speeds up indexing where docs have no attachments

If a document that is being indexed has no attachments, then no attempt will be made to lookup it's attachments. These documents are now retrieved in half the time.