refactoring...
- taken out document state as separate enum module
- used let to make test DRY
added tags and slug based search options
added sensible defaults for fetching documents