Namespace fixes. Update output class to support multiple emits per document when generating views with couchphpdb.