Added count parameter to the document service
Client implements all indexing methods

A lot of other refactoring :-(