Pretty up the formatting a bit for docs_in_es

Also look up doc_type on es_doc if couch_doc doesn't exist
http://manage.dimagi.com/default.asp?139919
@dannyroberts