Fix WS
functions to construct designdoc & view strings
Support reduce fun when adding to existing view doc