Validate document count

https://www.pivotaltracker.com/story/show/48238727
Adds validation to the document count for document based transactions.